Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java
41171 views
/*1* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.print.attribute.standard;2627import java.io.Serial;2829import javax.print.attribute.Attribute;30import javax.print.attribute.EnumSyntax;31import javax.print.attribute.PrintJobAttribute;32import javax.print.attribute.PrintRequestAttribute;3334/**35* Class {@code JobSheets} is a printing attribute class, an enumeration, that36* determines which job start and end sheets, if any, must be printed with a37* job. Class {@code JobSheets} declares keywords for standard job sheets38* values. Implementation- or site-defined names for a job sheets attribute may39* also be created by defining a subclass of class {@code JobSheets}.40* <p>41* The effect of a {@code JobSheets} attribute on multidoc print jobs (jobs with42* multiple documents) may be affected by the43* {@link MultipleDocumentHandling MultipleDocumentHandling} job attribute,44* depending on the meaning of the particular {@code JobSheets} value.45* <p>46* <b>IPP Compatibility:</b> The category name returned by {@code getName()} is47* the IPP attribute name. The enumeration's integer value is the IPP enum48* value. The {@code toString()} method returns the IPP string representation of49* the attribute value. For a subclass, the attribute value must be localized to50* give the IPP name and natural language values.51*52* @author Alan Kaminsky53*/54public class JobSheets extends EnumSyntax55implements PrintRequestAttribute, PrintJobAttribute {5657/**58* Use serialVersionUID from JDK 1.4 for interoperability.59*/60@Serial61private static final long serialVersionUID = -4735258056132519759L;6263/**64* No job sheets are printed.65*/66public static final JobSheets NONE = new JobSheets(0);6768/**69* One or more site specific standard job sheets are printed. e.g. a single70* start sheet is printed, or both start and end sheets are printed.71*/72public static final JobSheets STANDARD = new JobSheets(1);7374/**75* Construct a new job sheets enumeration value with the given integer76* value.77*78* @param value Integer value79*/80protected JobSheets(int value) {81super (value);82}8384/**85* The string table for class {@code JobSheets}.86*/87private static final String[] myStringTable = {88"none",89"standard"90};9192/**93* The enumeration value table for class {@code JobSheets}.94*/95private static final JobSheets[] myEnumValueTable = {96NONE,97STANDARD98};99100/**101* Returns the string table for class {@code JobSheets}.102*/103protected String[] getStringTable() {104return myStringTable.clone();105}106107/**108* Returns the enumeration value table for class {@code JobSheets}.109*/110protected EnumSyntax[] getEnumValueTable() {111return (EnumSyntax[])myEnumValueTable.clone();112}113114/**115* Get the printing attribute class which is to be used as the "category"116* for this printing attribute value.117* <p>118* For class {@code JobSheets} and any vendor-defined subclasses, the119* category is class {@code JobSheets} itself.120*121* @return printing attribute class (category), an instance of class122* {@link Class java.lang.Class}123*/124public final Class<? extends Attribute> getCategory() {125return JobSheets.class;126}127128/**129* Get the name of the category of which this attribute value is an130* instance.131* <p>132* For class {@code JobSheets} and any vendor-defined subclasses, the133* category name is {@code "job-sheets"}.134*135* @return attribute category name136*/137public final String getName() {138return "job-sheets";139}140}141142143