01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.groups.pags.testers;
07:
08: import org.jasig.portal.security.IPerson;
09:
10: /**
11: * Abstract class tests a possibly multi-valued attribute against
12: * a test value.
13: * <p>
14: * @author Dan Ellentuck
15: * @version $Revision: 34757 $
16: */
17:
18: public abstract class StringTester extends BaseAttributeTester {
19:
20: public StringTester(String attribute, String test) {
21: super (attribute, test);
22: }
23:
24: public boolean test(IPerson person) {
25: boolean result = false;
26: Object[] atts = person.getAttributeValues(getAttributeName());
27: if (atts != null) {
28: for (int i = 0; i < atts.length && result == false; i++) {
29: String att = (String) atts[i];
30: result = test(att);
31: }
32: }
33: return result;
34: }
35:
36: public boolean test(String att) {
37: return false;
38: }
39:
40: }
|