1 28 29 package com.caucho.jms.selector; 30 31 import javax.jms.JMSException ; 32 import javax.jms.Message ; 33 import java.util.HashMap ; 34 35 38 public class InSelector extends Selector { 39 private Selector _expr; 40 41 private HashMap <String ,String > _values; 42 43 InSelector(Selector expr) 44 { 45 _expr = expr; 46 _values = new HashMap <String ,String >(); 47 } 48 49 void addValue(String value) 50 { 51 _values.put(value, value); 52 } 53 54 58 Object evaluate(Message message) 59 throws JMSException 60 { 61 Object lobj = _expr.evaluate(message); 62 63 if (! (lobj instanceof String )) 64 return NULL; 65 66 return toBoolean(_values.get(lobj) != null); 67 } 68 } 69 | Popular Tags |