01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.common.function;
09:
10: //base classes
11:
12: //project specific classes
13: import org.jfolder.common.tagging.BaseAppraiseConceptTagContext;
14: import org.jfolder.common.tagging.ConceptTagCharacteristic;
15: import org.jfolder.common.tagging.DetermineValueAndClassConceptTagContext;
16: import org.jfolder.common.tagging.DetermineValueAndClassConceptTagException;
17: import org.jfolder.common.tagging.ReturnableConceptTag;
18: import org.jfolder.common.tagging.ValueAndClassForConceptTag;
19:
20: //other classes
21:
22: public class WebPageTagInstanceFormatContext extends
23: BaseAppraiseConceptTagContext {
24:
25: private boolean touched = false;
26: private boolean initialized = false;
27: private StringBuffer content = null;
28: //private ReturnableConceptTag rct = null;
29: private ConceptTagCharacteristic ctchar = null;
30: private DetermineValueAndClassConceptTagContext rvacfwtc = null;
31:
32: protected WebPageTagInstanceFormatContext(
33: ConceptTagCharacteristic inCtchar,
34: DetermineValueAndClassConceptTagContext inRvacfwtc) {
35: //
36: super (null, null);
37: //
38: this .touched = false;
39: this .content = new StringBuffer();
40: this .ctchar = inCtchar;
41: this .rvacfwtc = inRvacfwtc;
42: //
43: this .content.append("(Content not initialized)");
44: }
45:
46: public boolean isTouched() {
47: return this .touched;
48: }
49:
50: public void touch() {
51: this .touched = true;
52: }
53:
54: public ValueAndClassForConceptTag getValueAndClass()
55: throws DetermineValueAndClassConceptTagException {
56:
57: ValueAndClassForConceptTag outValue = null;
58:
59: this .touch();
60: outValue = this .ctchar.getDetermineValueAndClass(0,
61: this .rvacfwtc);
62:
63: return outValue;
64: }
65:
66: public void write(String inContent) {
67: if (this .initialized) {
68: this .content.append(inContent);
69: } else {
70: this .initialized = true;
71: this .content = new StringBuffer();
72: this .content.append(inContent);
73: }
74: }
75:
76: protected String getContent() {
77: return this.content.toString();
78: }
79: }
|