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