src/share/classes/javax/print/attribute/standard/JobName.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  31 import javax.print.attribute.PrintRequestAttribute;
  32 import javax.print.attribute.PrintJobAttribute;
  33 
  34 /**
  35  * Class JobName is a printing attribute class, a text attribute, that specifies
  36  * the name of a print job. A job's name is an arbitrary string defined by the
  37  * client. It does not need to be unique between different jobs. A Print Job's
  38  * JobName attribute is set to the value supplied by the client in the Print
  39  * Request's attribute set. If, however, the client does not supply a JobName
  40  * attribute in the Print Request, the printer, when it creates the Print Job,
  41  * must generate a JobName. The printer should generate the value of the Print
  42  * Job's JobName attribute from the first of the following sources that produces
  43  * a value: (1) the {@link DocumentName DocumentName} attribute of the first (or
  44  * only) doc in the job, (2) the URL of the first (or only) doc in the job, if
  45  * the doc's print data representation object is a URL, or (3) any other piece
  46  * of Print Job specific and/or document content information.
  47  * <P>
  48  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  49  * locale gives the IPP natural language. The category name returned by
  50  * <CODE>getName()</CODE> gives the IPP attribute name.
  51  * <P>
  52  *
  53  * @author  Alan Kaminsky
  54  */
  55 public final class JobName extends TextSyntax
  56         implements PrintRequestAttribute, PrintJobAttribute {
  57 
  58     private static final long serialVersionUID = 4660359192078689545L;
  59 
  60     /**
  61      * Constructs a new job name attribute with the given job name and locale.
  62      *
  63      * @param  jobName  Job name.
  64      * @param  locale   Natural language of the text string. null
  65      * is interpreted to mean the default locale as returned
  66      * by <code>Locale.getDefault()</code>
  67      *
  68      * @exception  NullPointerException
  69      *     (unchecked exception) Thrown if <CODE>jobName</CODE> is null.
  70      */
  71     public JobName(String jobName, Locale locale) {


   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  31 import javax.print.attribute.PrintRequestAttribute;
  32 import javax.print.attribute.PrintJobAttribute;
  33 
  34 /**
  35  * Class JobName is a printing attribute class, a text attribute, that specifies
  36  * the name of a print job. A job's name is an arbitrary string defined by the
  37  * client. It does not need to be unique between different jobs. A Print Job's
  38  * JobName attribute is set to the value supplied by the client in the Print
  39  * Request's attribute set. If, however, the client does not supply a JobName
  40  * attribute in the Print Request, the printer, when it creates the Print Job,
  41  * must generate a JobName. The printer should generate the value of the Print
  42  * Job's JobName attribute from the first of the following sources that produces
  43  * a value: (1) the {@link DocumentName DocumentName} attribute of the first (or
  44  * only) doc in the job, (2) the URL of the first (or only) doc in the job, if
  45  * the doc's print data representation object is a URL, or (3) any other piece
  46  * of Print Job specific and/or document content information.
  47  * <P>
  48  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  49  * locale gives the IPP natural language. The category name returned by
  50  * <CODE>getName()</CODE> gives the IPP attribute name.

  51  *
  52  * @author  Alan Kaminsky
  53  */
  54 public final class JobName extends TextSyntax
  55         implements PrintRequestAttribute, PrintJobAttribute {
  56 
  57     private static final long serialVersionUID = 4660359192078689545L;
  58 
  59     /**
  60      * Constructs a new job name attribute with the given job name and locale.
  61      *
  62      * @param  jobName  Job name.
  63      * @param  locale   Natural language of the text string. null
  64      * is interpreted to mean the default locale as returned
  65      * by <code>Locale.getDefault()</code>
  66      *
  67      * @exception  NullPointerException
  68      *     (unchecked exception) Thrown if <CODE>jobName</CODE> is null.
  69      */
  70     public JobName(String jobName, Locale locale) {