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: import org.apache.poi.util.HexDump;
21:
22: /**
23: * <p>This exception is thrown if HPSF encounters a variant type that is illegal
24: * in the current context.</p>
25: *
26: * @author Rainer Klute <a
27: * href="mailto:klute@rainer-klute.de"><klute@rainer-klute.de></a>
28: * @since 2004-06-21
29: * @version $Id: IllegalVariantTypeException.java 489730 2006-12-22 19:18:16Z bayard $
30: */
31: public class IllegalVariantTypeException extends VariantTypeException {
32:
33: /**
34: * <p>Constructor</p>
35: *
36: * @param variantType The unsupported variant type
37: * @param value The value
38: * @param msg A message string
39: */
40: public IllegalVariantTypeException(final long variantType,
41: final Object value, final String msg) {
42: super (variantType, value, msg);
43: }
44:
45: /**
46: * <p>Constructor</p>
47: *
48: * @param variantType The unsupported variant type
49: * @param value The value
50: */
51: public IllegalVariantTypeException(final long variantType,
52: final Object value) {
53: this (variantType, value, "The variant type " + variantType
54: + " (" + Variant.getVariantName(variantType) + ", "
55: + HexDump.toHex(variantType)
56: + ") is illegal in this context.");
57: }
58:
59: }
|