1. /*
  2. * @(#)PrinterMoreInfo.java 1.5 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.print.attribute.standard;
  8. import java.net.URI;
  9. import javax.print.attribute.URISyntax;
  10. import javax.print.attribute.PrintServiceAttribute;
  11. /**
  12. * Class PrinterMoreInfo is a printing attribute class, a URI, that is used to
  13. * obtain more information about this specific printer. For example, this
  14. * could be an HTTP type URI referencing an HTML page accessible to a web
  15. * browser. The information obtained from this URI is intended for end user
  16. * consumption. Features outside the scope of the Print Service API can be
  17. * accessed from this URI.
  18. * The information is intended to be specific to this printer instance and
  19. * site specific services (e.g. job pricing, services offered, end user
  20. * assistance).
  21. * <P>
  22. * In contrast, the {@link PrinterMoreInfoManufacturer
  23. * PrinterMoreInfoManufacturer} attribute is used to find out more information
  24. * about this general kind of printer rather than this specific printer.
  25. * <P>
  26. * <B>IPP Compatibility:</B> The string form returned by
  27. * <CODE>toString()</CODE> gives the IPP uri value.
  28. * The category name returned by <CODE>getName()</CODE>
  29. * gives the IPP attribute name.
  30. * <P>
  31. *
  32. * @author Alan Kaminsky
  33. */
  34. public final class PrinterMoreInfo extends URISyntax
  35. implements PrintServiceAttribute {
  36. /**
  37. * Constructs a new printer more info attribute with the specified URI.
  38. *
  39. * @param uri URI.
  40. *
  41. * @exception NullPointerException
  42. * (unchecked exception) Thrown if <CODE>uri</CODE> is null.
  43. */
  44. public PrinterMoreInfo(URI uri) {
  45. super (uri);
  46. }
  47. /**
  48. * Returns whether this printer more info attribute is equivalent to the
  49. * passed in object. To be equivalent, all of the following conditions
  50. * must be true:
  51. * <OL TYPE=1>
  52. * <LI>
  53. * <CODE>object</CODE> is not null.
  54. * <LI>
  55. * <CODE>object</CODE> is an instance of class PrinterMoreInfo.
  56. * <LI>
  57. * This printer more info attribute's URI and <CODE>object</CODE>'s URI
  58. * are equal.
  59. * </OL>
  60. *
  61. * @param object Object to compare to.
  62. *
  63. * @return True if <CODE>object</CODE> is equivalent to this printer
  64. * more info attribute, false otherwise.
  65. */
  66. public boolean equals(Object object) {
  67. return (super.equals(object) &&
  68. object instanceof PrinterMoreInfo);
  69. }
  70. /**
  71. * Get the printing attribute class which is to be used as the "category"
  72. * for this printing attribute value.
  73. * <P>
  74. * For class PrinterMoreInfo, the category is class PrinterMoreInfo itself.
  75. *
  76. * @return Printing attribute class (category), an instance of class
  77. * {@link java.lang.Class java.lang.Class}.
  78. */
  79. public final Class getCategory() {
  80. return PrinterMoreInfo.class;
  81. }
  82. /**
  83. * Get the name of the category of which this attribute value is an
  84. * instance.
  85. * <P>
  86. * For class PrinterMoreInfo, the
  87. * category name is <CODE>"printer-more-info"</CODE>.
  88. *
  89. * @return Attribute category name.
  90. */
  91. public final String getName() {
  92. return "printer-more-info";
  93. }
  94. }