private Value createDeviceColorValue(LexicalUnit lu, Value v, int expectedComponents) { lu = lu.getParameters(); boolean nChannel = (expectedComponents <= 0); DeviceColor col = new DeviceColor(nChannel); col.append(getColorValue(lu)); LexicalUnit lastUnit = lu; lu = lu.getNextLexicalUnit(); while (lu != null) { expectComma(lu); lu = lu.getNextLexicalUnit(); col.append(getColorValue(lu)); lastUnit = lu; lu = lu.getNextLexicalUnit(); } if (!nChannel && expectedComponents != col.getNumberOfColors()) { throw createInvalidLexicalUnitDOMException(lastUnit.getLexicalUnitType()); } return col; }
private Value createDeviceColorValue(LexicalUnit lu, Value v, int expectedComponents) { lu = lu.getParameters(); boolean nChannel = (expectedComponents <= 0); DeviceColor col = new DeviceColor(nChannel); col.append(getColorValue(lu)); LexicalUnit lastUnit = lu; lu = lu.getNextLexicalUnit(); while (lu != null) { expectComma(lu); lu = lu.getNextLexicalUnit(); col.append(getColorValue(lu)); lastUnit = lu; lu = lu.getNextLexicalUnit(); } if (!nChannel && expectedComponents != col.getNumberOfColors()) { throw createInvalidLexicalUnitDOMException(lastUnit.getLexicalUnitType()); } return col; }
private Value createDeviceColorValue(LexicalUnit lu, Value v, int expectedComponents) { lu = lu.getParameters(); boolean nChannel = (expectedComponents <= 0); DeviceColor col = new DeviceColor(nChannel); col.append(getColorValue(lu)); LexicalUnit lastUnit = lu; lu = lu.getNextLexicalUnit(); while (lu != null) { expectComma(lu); lu = lu.getNextLexicalUnit(); col.append(getColorValue(lu)); lastUnit = lu; lu = lu.getNextLexicalUnit(); } if (!nChannel && expectedComponents != col.getNumberOfColors()) { throw createInvalidLexicalUnitDOMException(lastUnit.getLexicalUnitType()); } return col; }