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 java.nio.charset;
19:
20: import org.apache.harmony.niochar.internal.nls.Messages;
21:
22: /**
23: * Thrown when an illegal charset name is encountered.
24: */
25: public class IllegalCharsetNameException extends
26: IllegalArgumentException {
27:
28: /*
29: * This constant is used during deserialization to check the J2SE version
30: * which created the serialized object.
31: */
32: private static final long serialVersionUID = 1457525358470002989L;
33:
34: // The illegal charset name
35: private String charsetName;
36:
37: /**
38: * Constructs an instance of this exception with the supplied charset name.
39: *
40: * @param charset
41: * the encountered illegal charset name
42: */
43: public IllegalCharsetNameException(String charset) {
44: // niochar.0F=The illegal charset name is "{0}".
45: super (Messages.getString("niochar.0F", charset)); //$NON-NLS-1$
46: this .charsetName = charset;
47: }
48:
49: /**
50: * Gets the encountered illegal charset name.
51: *
52: * @return the encountered illegal charset name
53: */
54: public String getCharsetName() {
55: return this.charsetName;
56: }
57: }
|