1. /*
  2. * @(#)PDLOverrideSupported.java 1.8 04/05/05
  3. *
  4. * Copyright 2004 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 javax.print.attribute.Attribute;
  9. import javax.print.attribute.EnumSyntax;
  10. import javax.print.attribute.PrintServiceAttribute;
  11. /**
  12. * Class PDLOverrideSupported is a printing attribute class, an enumeration,
  13. * that expresses the printer's ability to attempt to override processing
  14. * instructions embedded in documents' print data with processing instructions
  15. * specified as attributes outside the print data.
  16. * <P>
  17. * <B>IPP Compatibility:</B> The category name returned by
  18. * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
  19. * integer value is the IPP enum value. The <code>toString()</code> method
  20. * returns the IPP string representation of the attribute value.
  21. * <P>
  22. *
  23. * @author Alan Kaminsky
  24. */
  25. public class PDLOverrideSupported extends EnumSyntax
  26. implements PrintServiceAttribute {
  27. private static final long serialVersionUID = -4393264467928463934L;
  28. /**
  29. * The printer makes no attempt to make the external job attribute values
  30. * take precedence over embedded instructions in the documents' print
  31. * data.
  32. */
  33. public static final PDLOverrideSupported
  34. NOT_ATTEMPTED = new PDLOverrideSupported(0);
  35. /**
  36. * The printer attempts to make the external job attribute values take
  37. * precedence over embedded instructions in the documents' print data,
  38. * however there is no guarantee.
  39. */
  40. public static final PDLOverrideSupported
  41. ATTEMPTED = new PDLOverrideSupported(1);
  42. /**
  43. * Construct a new PDL override supported enumeration value with the given
  44. * integer value.
  45. *
  46. * @param value Integer value.
  47. */
  48. protected PDLOverrideSupported(int value) {
  49. super (value);
  50. }
  51. private static final String[] myStringTable = {
  52. "not-attempted",
  53. "attempted"
  54. };
  55. private static final PDLOverrideSupported[] myEnumValueTable = {
  56. NOT_ATTEMPTED,
  57. ATTEMPTED
  58. };
  59. /**
  60. * Returns the string table for class PDLOverrideSupported.
  61. */
  62. protected String[] getStringTable() {
  63. return (String[])myStringTable.clone();
  64. }
  65. /**
  66. * Returns the enumeration value table for class PDLOverrideSupported.
  67. */
  68. protected EnumSyntax[] getEnumValueTable() {
  69. return (EnumSyntax[])myEnumValueTable.clone();
  70. }
  71. /**
  72. * Get the printing attribute class which is to be used as the "category"
  73. * for this printing attribute value.
  74. * <P>
  75. * For class PDLOverrideSupported and any vendor-defined subclasses, the
  76. * category is class PDLOverrideSupported itself.
  77. *
  78. * @return Printing attribute class (category), an instance of class
  79. * {@link java.lang.Class java.lang.Class}.
  80. */
  81. public final Class<? extends Attribute> getCategory() {
  82. return PDLOverrideSupported.class;
  83. }
  84. /**
  85. * Get the name of the category of which this attribute value is an
  86. * instance.
  87. * <P>
  88. * For class PDLOverrideSupported and any vendor-defined subclasses, the
  89. * category name is <CODE>"pdl-override-supported"</CODE>.
  90. *
  91. * @return Attribute category name.
  92. */
  93. public final String getName() {
  94. return "pdl-override-supported";
  95. }
  96. }