public void setCategories(Set<String> categories) { this.categories = categories; this.matcher = ((this.categories != null) ? new JetspeedBeanDefinitionFilterMatcher(this.categories) : null); }
/** * Match a bean expression against the set of category names that were * used to construct this matcher. * * @param categoriesMatchExpression bean expression to be matched. * @return matching result. */ public boolean match(String categoriesMatchExpression) { List<String> expression = parse(categoriesMatchExpression); if (expression != null) { return evaluate(expression, 0, expression.size()); } return false; }
boolean left = evaluateTerm(expression, evaluateIndex, endIndex, termEndIndex); evaluateIndex = termEndIndex[0]; right = evaluateTerm(expression, evaluateIndex, endIndex, termEndIndex); evaluateIndex = termEndIndex[0]; right = evaluate(expression, evaluateIndex, endIndex); evaluateIndex = endIndex;
int closeIndex = indexOfClose(expression, evaluateIndex, endIndex); term = evaluate(expression, evaluateIndex+1, closeIndex); evaluateIndex = closeIndex+1;
public boolean match(BeanDefinition bd) { String beanCategoriesExpression = (String)bd.getAttribute(CATEGORY_META_KEY); boolean matched = true; if (beanCategoriesExpression != null) { matched = ((matcher != null) && matcher.match(beanCategoriesExpression)); } return matched; }
public void setCategories(String categories) { if (categories != null && categories.length()>0) { this.categories = new HashSet<String>(); StringTokenizer st = new StringTokenizer(categories, " ,;\t"); while (st.hasMoreTokens()) { this.categories.add(st.nextToken()); } this.matcher = new JetspeedBeanDefinitionFilterMatcher(this.categories); } else { this.categories = null; this.matcher = null; } }
this.matcher = new JetspeedBeanDefinitionFilterMatcher(this.categories);