01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: http://www.apache.org/licenses/LICENSE-2.0
10:
11: Unless required by applicable law or agreed to in writing, software
12: distributed under the License is distributed on an "AS IS" BASIS,
13: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: See the License for the specific language governing permissions and
15: limitations under the License.
16: ==================================================================== */
17:
18: package org.apache.poi.hpsf;
19:
20: /**
21: * <p>This exception is thrown if HPSF encounters a problem with a variant type.
22: * Concrete subclasses specifiy the problem further.</p>
23: *
24: * @author Rainer Klute <a
25: * href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de></a>
26: * @since 2004-06-21
27: * @version $Id: VariantTypeException.java 489730 2006-12-22 19:18:16Z bayard $
28: */
29: public abstract class VariantTypeException extends HPSFException {
30:
31: private Object value;
32:
33: private long variantType;
34:
35: /**
36: * <p>Constructor.</p>
37: *
38: * @param variantType The variant type causing the problem
39: * @param value The value who's variant type causes the problem
40: * @param msg A message text describing the problem
41: */
42: public VariantTypeException(final long variantType,
43: final Object value, final String msg) {
44: super (msg);
45: this .variantType = variantType;
46: this .value = value;
47: }
48:
49: /**
50: * <p>Returns the offending variant type.</p>
51: *
52: * @return the offending variant type.
53: */
54: public long getVariantType() {
55: return variantType;
56: }
57:
58: /**
59: * <p>Returns the value who's variant type caused the problem.</p>
60: *
61: * @return the value who's variant type caused the problem
62: */
63: public Object getValue() {
64: return value;
65: }
66:
67: }
|