boolean supported = false;
try {
IppDocument document;
IppResponse response;
IppAttributeGroup agroup;
IppAttributeGroupSet agroupset;
Attribute[] attrs;
String mime = null;
String aname;
aname = Ipp2Java.getIppAttributeNameByClass(attribute.getClass(),
-1);
if (aname == null) {
return false;
}
if (flavor == null) {
mime = "application/octet-stream";
} else {
mime = java2ipp(flavor).getMimeType();
}
if (attributes == null || attributes.isEmpty()) {
document = new IppDocument("Qwerty", mime, "");
agroupset = new IppAttributeGroupSet();
agroupset.setAttribute(aname, Ipp2Java.getIppByJava(attribute));
response = printer.requestValidateJob(aname, document,
agroupset);
agroup = response
.getGroup(IppAttributeGroup.TAG_UNSUPPORTED_ATTRIBUTES);
if (agroup == null) {
supported = true;
} else if (agroup != null && agroup.findAttribute(aname) < 0) {
supported = true;
}
} else {
document = new IppDocument("Qwerty", mime, "");
agroupset = new IppAttributeGroupSet();
agroupset.setAttribute(aname, Ipp2Java.getIppByJava(attribute));
attrs = attributes.toArray();
for (int i = 0, ii = attrs.length; i < ii; i++) {
agroupset.setAttribute(Ipp2Java.getIppAttributeNameByClass(
attrs[i].getClass(), -1), Ipp2Java
.getIppByJava(attrs[i]));
}
response = printer.requestValidateJob(aname, document,