01: /*
02: * This file is part of PFIXCORE.
03: *
04: * PFIXCORE is free software; you can redistribute it and/or modify
05: * it under the terms of the GNU Lesser General Public License as published by
06: * the Free Software Foundation; either version 2 of the License, or
07: * (at your option) any later version.
08: *
09: * PFIXCORE is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public License
15: * along with PFIXCORE; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: */
19:
20: package de.schlund.pfixcore.example;
21:
22: import java.util.HashMap;
23:
24: import org.apache.log4j.Logger;
25: import org.w3c.dom.Element;
26:
27: import de.schlund.pfixcore.workflow.Context;
28: import de.schlund.pfixcore.workflow.ContextResource;
29: import de.schlund.pfixxml.ResultDocument;
30:
31: /**
32: * ContextAdultInfo.java
33: *
34: *
35: * Created: Thu Oct 22 19:24:37 2001
36: *
37: * @author <a href="mailto:jtl@schlund.de">Jens Lautenbacher</a>
38: *
39: *
40: */
41:
42: public class ContextAdultInfoImpl implements ContextResource,
43: ContextAdultInfo {
44: private Boolean adult = null;
45: private HashMap<String, String> test = new HashMap<String, String>();
46: private final static Logger LOG = Logger
47: .getLogger(ContextAdultInfoImpl.class);
48:
49: public void init(Context context) {
50: }
51:
52: public void reset() {
53: adult = null;
54: }
55:
56: public void setIndexedTest(HashMap<String, String> inmap) {
57: test = inmap;
58: }
59:
60: public HashMap<String, String> getIndexedTest() {
61: return test;
62: }
63:
64: public Boolean getAdult() {
65: return adult;
66: }
67:
68: public void setAdult(Boolean adult) {
69: this .adult = adult;
70: }
71:
72: public boolean needsData() {
73: if (adult == null) {
74: return true;
75: } else {
76: return false;
77: }
78: }
79:
80: public String toString() {
81: LOG.debug("Doing ContextAdultInfo...");
82: return "[Adult?: " + adult + "]";
83: }
84:
85: public void insertStatus(ResultDocument resdoc, Element node)
86: throws Exception {
87: node.setAttribute("adult", "" + getAdult());
88: }
89:
90: }// ContextAdultInfo
|