Here you can find the source of isValueSupported(PrintService ps, Attribute attr, DocFlavor flavor, AttributeSet attributes)
public static boolean isValueSupported(PrintService ps, Attribute attr, DocFlavor flavor, AttributeSet attributes)
//package com.java2s; /*/* w ww . j ava2s . c o m*/ * Copyright (C) 2015 University of Oregon * * You may distribute under the terms of either the GNU General Public * License or the Apache License, as specified in the LICENSE file. * * For more information, see the LICENSE file. */ import javax.print.*; import javax.print.attribute.*; public class Main { public static boolean isValueSupported(PrintService ps, Attribute attr, DocFlavor flavor, AttributeSet attributes) { boolean retVal = false; if (ps == null || !isGoodPrinterName(ps.getName())) return retVal; try { retVal = ps.isAttributeValueSupported(attr, flavor, attributes); } catch (Exception e) { retVal = false; } return retVal; } public static boolean isGoodPrinterName(String name) { if (name == null) return false; if (name.equals("jeff_pl") || name.equals("jeff_pr")) return false; if (name.equals("steve_pl") || name.equals("steve_pr")) return false; return true; } }