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 javax.print.attribute.standard;
19:
20: import javax.print.attribute.Attribute;
21: import javax.print.attribute.EnumSyntax;
22:
23: /*
24: * table values are obtained from rfc2911: internet printing protocol/1.1:
25: * model and semantics, section 4.4.12 http://ietf.org/rfc/rfc2911.txt?number=2911
26: */
27: public final class Severity extends EnumSyntax implements Attribute {
28: private static final long serialVersionUID = 8781881462717925380L;
29:
30: public static final Severity REPORT = new Severity(0);
31:
32: public static final Severity WARNING = new Severity(1);
33:
34: public static final Severity ERROR = new Severity(2);
35:
36: private static final Severity[] enumValueTable = { REPORT, WARNING,
37: ERROR };
38:
39: private static final String[] stringTable = { "report", "warning",
40: "error" };
41:
42: protected Severity(int value) {
43: super (value);
44: }
45:
46: public final Class<? extends Attribute> getCategory() {
47: return Severity.class;
48: }
49:
50: @Override
51: protected EnumSyntax[] getEnumValueTable() {
52: return enumValueTable.clone();
53: }
54:
55: public final String getName() {
56: return "severity";
57: }
58:
59: @Override
60: protected String[] getStringTable() {
61: return stringTable.clone();
62: }
63: }
|