/** * Constructs a new <code>BridgeException</code> based on the specified * <code>LiveAttributeException</code>. * * @param ctx the bridge context to use for determining the element's * source position * @param ex the {@link LiveAttributeException} */ public BridgeException(BridgeContext ctx, LiveAttributeException ex) { switch (ex.getCode()) { case LiveAttributeException.ERR_ATTRIBUTE_MISSING: this.code = ErrorConstants.ERR_ATTRIBUTE_MISSING; break; case LiveAttributeException.ERR_ATTRIBUTE_MALFORMED: this.code = ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED; break; case LiveAttributeException.ERR_ATTRIBUTE_NEGATIVE: this.code = ErrorConstants.ERR_LENGTH_NEGATIVE; break; default: throw new IllegalStateException ("Unknown LiveAttributeException error code " + ex.getCode()); } this.e = ex.getElement(); this.params = new Object[] { ex.getAttributeName(), ex.getValue() }; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> based on the specified * <code>LiveAttributeException</code>. * * @param ctx the bridge context to use for determining the element's * source position * @param ex the {@link LiveAttributeException} */ public BridgeException(BridgeContext ctx, LiveAttributeException ex) { switch (ex.getCode()) { case LiveAttributeException.ERR_ATTRIBUTE_MISSING: this.code = ErrorConstants.ERR_ATTRIBUTE_MISSING; break; case LiveAttributeException.ERR_ATTRIBUTE_MALFORMED: this.code = ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED; break; case LiveAttributeException.ERR_ATTRIBUTE_NEGATIVE: this.code = ErrorConstants.ERR_LENGTH_NEGATIVE; break; default: throw new IllegalStateException ("Unknown LiveAttributeException error code " + ex.getCode()); } this.e = ex.getElement(); this.params = new Object[] { ex.getAttributeName(), ex.getValue() }; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }
/** * Constructs a new <code>BridgeException</code> based on the specified * <code>LiveAttributeException</code>. * * @param ctx the bridge context to use for determining the element's * source position * @param ex the {@link LiveAttributeException} */ public BridgeException(BridgeContext ctx, LiveAttributeException ex) { switch (ex.getCode()) { case LiveAttributeException.ERR_ATTRIBUTE_MISSING: this.code = ErrorConstants.ERR_ATTRIBUTE_MISSING; break; case LiveAttributeException.ERR_ATTRIBUTE_MALFORMED: this.code = ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED; break; case LiveAttributeException.ERR_ATTRIBUTE_NEGATIVE: this.code = ErrorConstants.ERR_LENGTH_NEGATIVE; break; default: throw new IllegalStateException ("Unknown LiveAttributeException error code " + ex.getCode()); } this.e = ex.getElement(); this.params = new Object[] { ex.getAttributeName(), ex.getValue() }; if (e != null && ctx != null) { this.line = ctx.getDocumentLoader().getLineNumber(e); } }