001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.common.tagging;
009:
010: //base classes
011:
012: //project specific classes
013: import org.jfolder.common.UnexpectedSystemException;
014: import org.jfolder.common.utils.misc.MiscHelper;
015:
016: //other classes
017:
018: public abstract class BaseDetermineValueAndClassConceptTagContext
019: extends BaseConceptTagCallContext implements
020: DetermineValueAndClassConceptTagContext {
021:
022: private ValueAndClassForConceptTag vac = null;
023: private Exception e = null;
024:
025: //
026: //private Exception removeTestException = null;
027:
028: protected BaseDetermineValueAndClassConceptTagContext(
029: ConceptTagPreferences inCtp, ConceptTagFlags inCtf) {
030: //
031: super (inCtp, inCtf);
032: }
033:
034: public void reset() {
035: this .vac = null;
036: this .e = null;
037: }
038:
039: //
040: public boolean isDetermineValueAndClassPresent() {
041: return (this .vac != null);
042: }
043:
044: public void setDetermineValueAndClass(
045: ValueAndClassForConceptTag inVacfct) {
046: //
047: if (this .e != null) {
048: throw new UnexpectedSystemException(
049: "Exception already declared");
050: } else if (this .vac != null) {
051: throw new UnexpectedSystemException(
052: "Value already declared");
053: }
054: //
055: this .vac = inVacfct;
056: //
057: //this.removeTestException = new Exception();
058: }
059:
060: public ValueAndClassForConceptTag getDetermineValueAndClass() {
061: return this .vac;
062: }
063:
064: //
065: public boolean isDetermineExceptionPresent() {
066: return (this .e != null);
067: }
068:
069: public void setDetermineException(Exception inException) {
070: //
071: if (this .vac != null) {
072: throw new UnexpectedSystemException(
073: "Value already declared");
074: } else if (this .e != null) {
075: throw new UnexpectedSystemException(
076: "Exception already declared");
077: }
078: //
079: this .e = inException;
080: //
081: //this.removeTestException = new Exception();
082: }
083:
084: public Exception getDetermineException() {
085: return this .e;
086: }
087:
088: public void pushStatus(ValueAndClassForConceptTag inVacfct[],
089: Exception inException[]) {
090: //
091: inVacfct[0] = this .vac;
092: inException[0] = this .e;
093: //
094: this .vac = null;
095: this .e = null;
096: //MiscHelper.println("DetermineVacConceptTagContext pushStatus NotImp");
097: }
098:
099: public void popStatus(ValueAndClassForConceptTag inVacfct[],
100: Exception inException[]) {
101: //
102: this .vac = inVacfct[0];
103: this .e = inException[0];
104: //MiscHelper.println("DetermineVacConceptTagContext popStatus NotImp");
105: }
106: }
|