/** {@inheritDoc} */ public String getMessage() { if (propertyName != null) { return super.getMessage() + "; property:'" + propertyName + "'"; } else { return super.getMessage(); } } }
private void setInputFormat(int format) throws FOPException { if (inputmode == NOT_SET || inputmode == format) { inputmode = format; } else { throw new FOPException("Only one input mode can be specified!"); } }
/** * Prints this FOP exception and its backtrace to the specified print stream. * @param stream PrintStream to use for output */ public void printStackTrace(java.io.PrintStream stream) { synchronized (stream) { super.printStackTrace(stream); if (getException() != null) { stream.println(EXCEPTION_SEPARATOR); getException().printStackTrace(stream); } if (getRootException() != null) { stream.println(EXCEPTION_SEPARATOR); getRootException().printStackTrace(stream); } } }
/** * Sets the scaling so the contents fit into the window. */ public void setScaleToFitWindow() { try { setScale(previewPanel.getScaleToFitWindow() * 100); } catch (FOPException fopEx) { fopEx.printStackTrace(); } }
/** * Constructs a new FOP exception with the specified detail message and location. * @param message the detail message. * @param locator the locator holding the location. */ public FOPException(String message, Locator locator) { super(message); setLocator(locator); }
/** * Attempts to recast the exception as other Throwable types. * @return the exception recast as another type if possible, otherwise null. */ protected Throwable getRootException() { Throwable result = getException(); if (result instanceof SAXException) { result = ((SAXException)result).getException(); } if (result instanceof java.lang.reflect.InvocationTargetException) { result = ((java.lang.reflect.InvocationTargetException)result).getTargetException(); } if (result != getException()) { return result; } return null; }
/** * Returns the detail message string of this FOP exception. * If a location was set, the message is prepended with it in the * form * <pre> * SystemId:LL:CC: &the message& * </pre> * (the format used by most GNU tools) * @return the detail message string of this FOP exception */ public String getMessage() { if (isLocationSet()) { return systemId + ":" + line + ":" + column + ": " + super.getMessage(); } else { return super.getMessage(); } }
/** * Sets the scaling so the contents are spread over the whole width available. */ public void setScaleToFitWidth() { try { setScale(previewPanel.getScaleToFitWidth() * 100); } catch (FOPException fopEx) { fopEx.printStackTrace(); } }
private void setOutputMode(String mime) throws FOPException { if (outputmode == null) { outputmode = mime; } else { throw new FOPException("you can only set one output method"); } }
/** {@inheritDoc} */ public void startLeader(Leader l) { if (bDefer) { return; } try { percentManager.setDimension(l); RtfAttributes rtfAttr = TextAttributesConverter.convertLeaderAttributes( l, percentManager); IRtfTextrunContainer container = (IRtfTextrunContainer)builderContext.getContainer( IRtfTextrunContainer.class, true, this); RtfTextrun textrun = container.getTextrun(); textrun.addLeader(rtfAttr); } catch (IOException e) { log.error("startLeader: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } catch (FOPException e) { log.error("startLeader: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } }
/** * Prints this FOP exception and its backtrace to the standard error stream. */ public void printStackTrace() { synchronized (System.err) { super.printStackTrace(); if (getException() != null) { System.err.println(EXCEPTION_SEPARATOR); getException().printStackTrace(); } if (getRootException() != null) { System.err.println(EXCEPTION_SEPARATOR); getRootException().printStackTrace(); } } }
fopEx.printStackTrace();
public void delete() throws FOPException { throw new FOPException("Font Cache disabled"); }
/** {@inheritDoc} */ public void startList(ListBlock lb) { if (bDefer) { return; } try { // create an RtfList in the current list container final IRtfListContainer c = (IRtfListContainer)builderContext.getContainer( IRtfListContainer.class, true, this); final RtfList newList = c.newList( ListAttributesConverter.convertAttributes(lb)); builderContext.pushContainer(newList); } catch (IOException ioe) { handleIOTrouble(ioe); } catch (FOPException fe) { log.error("startList: " + fe.getMessage()); throw new RuntimeException(fe.getMessage()); } catch (Exception e) { log.error("startList: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } }
/** * Prints this FOP exception and its backtrace to the specified print writer. * @param writer PrintWriter to use for output */ public void printStackTrace(java.io.PrintWriter writer) { synchronized (writer) { super.printStackTrace(writer); if (getException() != null) { writer.println(EXCEPTION_SEPARATOR); getException().printStackTrace(writer); } if (getRootException() != null) { writer.println(EXCEPTION_SEPARATOR); getRootException().printStackTrace(writer); } } }
/** * Returns a page viewport. * @param pageIndex the page index (zero-based) * @return the requested PageViewport instance * @exception FOPException If the page is out of range. */ public PageViewport getPageViewport(int pageIndex) throws FOPException { if (pageIndex < 0 || pageIndex >= pageViewportList.size()) { throw new FOPException("Requested page number is out of range: " + pageIndex + "; only " + pageViewportList.size() + " page(s) available."); } return (PageViewport) pageViewportList.get(pageIndex); }
throw new JspException("Cannot configure pdf export " + e.getMessage(), e); //$NON-NLS-1$
/** * Convenience method that handles any error appropriately * @param log log * @param e exception * @param strict validate strictly * @throws FOPException fop exception */ public static void handleException(Log log, Exception e, boolean strict) throws FOPException { if (strict) { if (e instanceof FOPException) { throw (FOPException)e; } throw new FOPException(e); } log.error(e.getMessage()); } }
/** {@inheritDoc} */ public void startInline(Inline inl) { if (bDefer) { return; } try { RtfAttributes rtfAttr = TextAttributesConverter.convertCharacterAttributes(inl); IRtfTextrunContainer container = (IRtfTextrunContainer)builderContext.getContainer( IRtfTextrunContainer.class, true, this); RtfTextrun textrun = container.getTextrun(); textrun.pushInlineAttributes(rtfAttr); textrun.addBookmark(inl.getId()); } catch (IOException ioe) { handleIOTrouble(ioe); } catch (FOPException fe) { log.error("startInline:" + fe.getMessage()); throw new RuntimeException(fe.getMessage()); } catch (Exception e) { log.error("startInline:" + e.getMessage()); throw new RuntimeException(e.getMessage()); } }