01: /* Licensed to the Apache Software Foundation (ASF) under one or more
02: * contributor license agreements. See the NOTICE file distributed with
03: * this work for additional information regarding copyright ownership.
04: * The ASF licenses this file to You under the Apache License, Version 2.0
05: * (the "License"); you may not use this file except in compliance with
06: * the License. You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package java.util;
18:
19: import java.io.Serializable;
20:
21: /**
22: * The unchecked exception will be thrown out if the combination of the format
23: * flags is illegal.
24: */
25: public class IllegalFormatFlagsException extends IllegalFormatException
26: implements Serializable {
27:
28: private static final long serialVersionUID = 790824L;
29:
30: private String flags;
31:
32: /**
33: * Constructs an IllegalFormatFlagsException with the specified flags.
34: *
35: * @param f
36: * The specified flags.
37: */
38: public IllegalFormatFlagsException(String f) {
39: if (null == f) {
40: throw new NullPointerException();
41: }
42: flags = f;
43: }
44:
45: /**
46: * Return the flags that are illegal.
47: *
48: * @return The flags that are illegal.
49: */
50: public String getFlags() {
51: return flags;
52: }
53:
54: /**
55: * Return the message string of the IllegalFormatFlagsException.
56: *
57: * @return The message string of the IllegalFormatFlagsException.
58: */
59: @Override
60: public String getMessage() {
61: StringBuilder buffer = new StringBuilder();
62: buffer.append("Flags = '");
63: buffer.append(flags);
64: buffer.append("'");
65: return buffer.toString();
66: }
67: }
|