001: /**********************************************************************
002: Copyright (c) 2002 Mike Martin (TJDO) and others. All rights reserved.
003: Licensed under the Apache License, Version 2.0 (the "License");
004: you may not use this file except in compliance with the License.
005: You may obtain a copy of the License at
006:
007: http://www.apache.org/licenses/LICENSE-2.0
008:
009: Unless required by applicable law or agreed to in writing, software
010: distributed under the License is distributed on an "AS IS" BASIS,
011: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012: See the License for the specific language governing permissions and
013: limitations under the License.
014:
015: Contributors:
016: Andy Jefferson - coding standards
017: ...
018: **********************************************************************/package org.jpox.store.fieldmanager;
019:
020: import org.jpox.exceptions.JPOXException;
021:
022: /**
023: * Abstract representation of a field manager.
024: *
025: * @version $Revision: 1.4 $
026: **/
027: public abstract class AbstractFieldManager implements FieldManager {
028: /**
029: * Default constructor
030: */
031: public AbstractFieldManager() {
032: //default constructor
033: }
034:
035: private String failureMessage(String method) {
036: return "Somehow " + getClass().getName() + "." + method
037: + "() was called, which should have been impossible";
038: }
039:
040: public void storeBooleanField(int fieldNumber, boolean value) {
041: throw new JPOXException(failureMessage("storeBooleanField"))
042: .setFatal();
043: }
044:
045: public boolean fetchBooleanField(int fieldNumber) {
046: throw new JPOXException(failureMessage("fetchBooleanField"))
047: .setFatal();
048: }
049:
050: public void storeCharField(int fieldNumber, char value) {
051: throw new JPOXException(failureMessage("storeCharField"))
052: .setFatal();
053: }
054:
055: public char fetchCharField(int fieldNumber) {
056: throw new JPOXException(failureMessage("fetchCharField"))
057: .setFatal();
058: }
059:
060: public void storeByteField(int fieldNumber, byte value) {
061: throw new JPOXException(failureMessage("storeByteField"))
062: .setFatal();
063: }
064:
065: public byte fetchByteField(int fieldNumber) {
066: throw new JPOXException(failureMessage("fetchByteField"))
067: .setFatal();
068: }
069:
070: public void storeShortField(int fieldNumber, short value) {
071: throw new JPOXException(failureMessage("storeShortField"))
072: .setFatal();
073: }
074:
075: public short fetchShortField(int fieldNumber) {
076: throw new JPOXException(failureMessage("fetchShortField"))
077: .setFatal();
078: }
079:
080: public void storeIntField(int fieldNumber, int value) {
081: throw new JPOXException(failureMessage("storeIntField"))
082: .setFatal();
083: }
084:
085: public int fetchIntField(int fieldNumber) {
086: throw new JPOXException(failureMessage("fetchIntField"))
087: .setFatal();
088: }
089:
090: public void storeLongField(int fieldNumber, long value) {
091: throw new JPOXException(failureMessage("storeLongField"))
092: .setFatal();
093: }
094:
095: public long fetchLongField(int fieldNumber) {
096: throw new JPOXException(failureMessage("fetchLongField"))
097: .setFatal();
098: }
099:
100: public void storeFloatField(int fieldNumber, float value) {
101: throw new JPOXException(failureMessage("storeFloatField"))
102: .setFatal();
103: }
104:
105: public float fetchFloatField(int fieldNumber) {
106: throw new JPOXException(failureMessage("fetchFloatField"))
107: .setFatal();
108: }
109:
110: public void storeDoubleField(int fieldNumber, double value) {
111: throw new JPOXException(failureMessage("storeDoubleField"))
112: .setFatal();
113: }
114:
115: public double fetchDoubleField(int fieldNumber) {
116: throw new JPOXException(failureMessage("fetchDoubleField"))
117: .setFatal();
118: }
119:
120: public void storeStringField(int fieldNumber, String value) {
121: throw new JPOXException(failureMessage("storeStringField"))
122: .setFatal();
123: }
124:
125: public String fetchStringField(int fieldNumber) {
126: throw new JPOXException(failureMessage("fetchStringField"))
127: .setFatal();
128: }
129:
130: public void storeObjectField(int fieldNumber, Object value) {
131: throw new JPOXException(failureMessage("storeObjectField"))
132: .setFatal();
133: }
134:
135: public Object fetchObjectField(int fieldNumber) {
136: throw new JPOXException(failureMessage("fetchObjectField"))
137: .setFatal();
138: }
139: }
|