001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * LGPL Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005-2006 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.unifiedGui.validator;
032:
033: import java.util.*;
034:
035: public abstract class AUnValidator implements IUnValidator {
036: private ArrayList pem_and = null;
037: private ArrayList pem_or = null;
038:
039: /**
040: * Kann nicht instantiiert werden
041: */
042: protected AUnValidator() {
043: };
044:
045: /**
046: * <p>
047: * Does...
048: * </p>
049: * <p>
050: *
051: * @return a Type with
052: * </p>
053: * <p>
054: * @param
055: * </p>
056: */
057: public final String pcmf_validate(Object xtoValidate) {
058: String l_ret = this .pcmf_validateMethod(xtoValidate);
059:
060: if (this .pem_and != null && l_ret == null) {
061: Iterator l_ita = this .pem_and.iterator();
062: while (l_ita.hasNext()) {
063: l_ret = ((IUnValidator) l_ita.next())
064: .pcmf_validate(xtoValidate);
065: if (l_ret != null)
066: break;
067: }
068: }
069: if (this .pem_or != null && l_ret != null) {
070: Iterator l_ita = this .pem_and.iterator();
071: while (l_ita.hasNext()) {
072: l_ret = ((IUnValidator) l_ita.next())
073: .pcmf_validate(xtoValidate);
074: if (l_ret == null)
075: return (null);
076: }
077: }
078: return (l_ret);
079: }
080:
081: /**
082: * <p>
083: * Does...
084: * </p>
085: * <p>
086: *
087: * @return a Type with
088: * </p>
089: * <p>
090: * @param
091: * </p>
092: */
093: public void pcmf_addValidator_AND(IUnValidator xValid) {
094: if (this .pem_and == null)
095: this .pem_and = new ArrayList();
096:
097: this .pem_and.add(xValid);
098:
099: return;
100: }
101:
102: /**
103: * <p>
104: * Does...
105: * </p>
106: * <p>
107: *
108: * @return a Type with
109: * </p>
110: * <p>
111: * @param
112: * </p>
113: */
114: public void pcmf_addValidator_OR(IUnValidator xValid) {
115: if (this .pem_or == null)
116: this .pem_or = new ArrayList();
117:
118: this.pem_or.add(xValid);
119:
120: return;
121: }
122: }
|