1 23 24 package org.apache.slide.search.basic.expression; 25 26 import org.apache.slide.search.InvalidQueryException; 27 import org.apache.slide.search.basic.ComparableResource; 28 import org.apache.slide.search.basic.ComparableResourcesPool; 29 import org.apache.slide.search.basic.Literals; 30 import org.jdom.Element; 31 32 37 public class ContainsExpression extends CompareExpression { 38 39 protected String searchedText; 40 41 47 public ContainsExpression (Element e, ComparableResourcesPool requestedResourcesPool) throws InvalidQueryException { 48 super(e, requestedResourcesPool); 49 searchedText = e.getTextTrim(); 50 } 51 52 60 protected boolean compare (ComparableResource item) { 61 return item.contains (searchedText) == Literals.TRUE; 62 } 63 64 65 71 public String toString () { 72 return (Literals.CONTAINS + " (" + searchedText + ")"); 73 } 74 } 75 76 | Popular Tags |