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

Print this page




  26 
  27 import java.util.Locale;
  28 
  29 import javax.print.attribute.Attribute;
  30 import javax.print.attribute.TextSyntax;
  31 import javax.print.attribute.DocAttribute;
  32 
  33 /**
  34  * Class DocumentName is a printing attribute class, a text attribute, that
  35  * specifies the name of a document. DocumentName is an attribute of the print
  36  * data (the doc), not of the Print Job. A document's name is an arbitrary
  37  * string defined by the client.
  38  * However if a JobName is not specified, the DocumentName should be used
  39  * instead, which implies that supporting specification of DocumentName
  40  * requires reporting of JobName and vice versa.
  41  * See {@link JobName JobName} for more information.
  42  * <P>
  43  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  44  * locale gives the IPP natural language. The category name returned by
  45  * <CODE>getName()</CODE> gives the IPP attribute name.
  46  * <P>
  47  *
  48  * @author  Alan Kaminsky
  49  */
  50 public final class DocumentName extends TextSyntax implements DocAttribute {
  51 
  52     private static final long serialVersionUID = 7883105848533280430L;
  53 
  54     /**
  55      * Constructs a new document name attribute with the given document name
  56      * and locale.
  57      *
  58      * @param  documentName  Document name.
  59      * @param  locale        Natural language of the text string. null
  60      * is interpreted to mean the default locale as returned
  61      * by <code>Locale.getDefault()</code>
  62      *
  63      * @exception  NullPointerException
  64      *   (unchecked exception) Thrown if <CODE>documentName</CODE> is null.
  65      */
  66     public DocumentName(String documentName, Locale locale) {




  26 
  27 import java.util.Locale;
  28 
  29 import javax.print.attribute.Attribute;
  30 import javax.print.attribute.TextSyntax;
  31 import javax.print.attribute.DocAttribute;
  32 
  33 /**
  34  * Class DocumentName is a printing attribute class, a text attribute, that
  35  * specifies the name of a document. DocumentName is an attribute of the print
  36  * data (the doc), not of the Print Job. A document's name is an arbitrary
  37  * string defined by the client.
  38  * However if a JobName is not specified, the DocumentName should be used
  39  * instead, which implies that supporting specification of DocumentName
  40  * requires reporting of JobName and vice versa.
  41  * See {@link JobName JobName} for more information.
  42  * <P>
  43  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  44  * locale gives the IPP natural language. The category name returned by
  45  * <CODE>getName()</CODE> gives the IPP attribute name.

  46  *
  47  * @author  Alan Kaminsky
  48  */
  49 public final class DocumentName extends TextSyntax implements DocAttribute {
  50 
  51     private static final long serialVersionUID = 7883105848533280430L;
  52 
  53     /**
  54      * Constructs a new document name attribute with the given document name
  55      * and locale.
  56      *
  57      * @param  documentName  Document name.
  58      * @param  locale        Natural language of the text string. null
  59      * is interpreted to mean the default locale as returned
  60      * by <code>Locale.getDefault()</code>
  61      *
  62      * @exception  NullPointerException
  63      *   (unchecked exception) Thrown if <CODE>documentName</CODE> is null.
  64      */
  65     public DocumentName(String documentName, Locale locale) {