attrx.add(a);
}
}
} else if (aname.equals("printer-state-reason")
|| aname.equals("printer-state-reasons")) {
PrinterStateReasons rs = new PrinterStateReasons();
String r;
Severity s;
for (int i = 0, ii = avalue.size(); i < ii; i++) {
r = new String((byte[]) avalue.get(i));
if (r.endsWith("-error")) {
r = r.substring(0, r.indexOf("-error"));
s = Severity.ERROR;
} else if (r.endsWith("-warning")) {
r = r.substring(0, r.indexOf("-warning"));
s = Severity.WARNING;
} else if (r.endsWith("-report")) {
r = r.substring(0, r.indexOf("-report"));
s = Severity.WARNING;
} else {
s = Severity.ERROR;
}
a = (Attribute) IppAttributeUtils.getObject(
PrinterStateReason.class, r);
if (a != null) {
rs.put((PrinterStateReason)a, s);
}
}
if (rs.size() > 0) {
attrx.add(rs);
}
} else if (aname.equals("copies") || aname.equals("copies-default")
|| aname.equals("copies-supported")) {
for (int i = 0, ii = avalue.size(); i < ii; i++) {