inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);
/** * Pop the Integer object at the top of the stack. * This code also illustrates usage of Joran's error handling paradigm. */ int fetchInteger(InterpretationContext ic) { int result = 0; try { // Pop the object at the top of the interpretation context's stack. Object o1 = ic.popObject(); if (o1 instanceof Integer) { result = ((Integer) o1).intValue(); } else { String errMsg = "Object [" + o1 + "] currently at the top of the stack is not an integer."; ic.addError(errMsg); throw new IllegalArgumentException(errMsg); } } catch (EmptyStackException ese) { ic.addError(("Expecting an integer on the execution stack.")); throw ese; } return result; }
/** * Pop the Integer object at the top of the stack. This code illustrates usage * of Joran's error handling paradigm. */ int fetchInteger(InterpretationContext ic) { int result = 0; try { Object o1 = ic.popObject(); if (o1 instanceof Integer) { result = ((Integer) o1).intValue(); } else { String errMsg = "Object [" + o1 + "] currently at the top of the stack is not an integer."; ic.addError(errMsg); throw new IllegalArgumentException(errMsg); } } catch (EmptyStackException ese) { ic.addError("Expecting an integer on the execution stack."); throw ese; } return result; }
public void begin(InterpretationContext ic, String name, Attributes attributes) { String valueStr = attributes.getValue(VALUE_ATR); if (OptionHelper.isEmpty(valueStr)) { ic.addError("The literal action requires a value attribute"); return; } try { Integer i = Integer.valueOf(valueStr); ic.pushObject(i); } catch (NumberFormatException nfe) { ic.addError("The value [" + valueStr + "] could not be converted to an Integer", nfe); throw nfe; } }
inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);
inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);
inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);
inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);
inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);
inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);
inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);
inError = true; errorMsg = "No 'converterClass' attribute in <conversionRule>"; ec.addError(errorMsg);