/** * Report a print conversion error. */ public static void handlePrintConversionException( Object caller, Exception e, XMLSerializer serializer ) throws SAXException { ValidationEvent ve = new PrintConversionEventImpl( ValidationEvent.ERROR, e.getMessage(), new ValidationEventLocatorImpl(caller) ); serializer.reportError(ve); } }
/** * Reports a print conversion error while marshalling. */ public static void handlePrintConversionException( Object caller, Exception e, XMLSerializer serializer ) throws SAXException { if( e instanceof SAXException ) // assume this exception is not from application. // (e.g., when a marshaller aborts the processing, this exception // will be thrown) throw (SAXException)e; String message = e.getMessage(); if(message==null) { message = e.toString(); } ValidationEvent ve = new PrintConversionEventImpl( ValidationEvent.ERROR, message, new ValidationEventLocatorImpl(caller), e ); serializer.reportError(ve); }
/** * Reports a print conversion error while marshalling. */ public static void handlePrintConversionException( Object caller, Exception e, XMLSerializer serializer ) throws SAXException { if( e instanceof SAXException ) // assume this exception is not from application. // (e.g., when a marshaller aborts the processing, this exception // will be thrown) throw (SAXException)e; String message = e.getMessage(); if(message==null) { message = e.toString(); } ValidationEvent ve = new PrintConversionEventImpl( ValidationEvent.ERROR, message, new ValidationEventLocatorImpl(caller), e ); serializer.reportError(ve); }
/** * Reports a print conversion error while marshalling. */ public static void handlePrintConversionException( Object caller, Exception e, XMLSerializer serializer ) throws SAXException { if( e instanceof SAXException ) // assume this exception is not from application. // (e.g., when a marshaller aborts the processing, this exception // will be thrown) throw (SAXException)e; String message = e.getMessage(); if(message==null) { message = e.toString(); } ValidationEvent ve = new PrintConversionEventImpl( ValidationEvent.ERROR, message, new ValidationEventLocatorImpl(caller), e ); serializer.reportError(ve); }
/** * Reports a print conversion error while marshalling. */ public static void handlePrintConversionException( Object caller, Exception e, XMLSerializer serializer ) throws SAXException { if( e instanceof SAXException ) // assume this exception is not from application. // (e.g., when a marshaller aborts the processing, this exception // will be thrown) throw (SAXException)e; String message = e.getMessage(); if(message==null) { message = e.toString(); } ValidationEvent ve = new PrintConversionEventImpl( ValidationEvent.ERROR, message, new ValidationEventLocatorImpl(caller), e ); serializer.reportError(ve); }
public void printConversionEvent(Object pObject, String pMsg, Exception pException) throws SAXException { ValidationEventHandler handler = getJMMarshaller().getEventHandler(); if (handler != null) { ValidationEventLocator locator = new ValidationEventLocatorImpl(pObject); PrintConversionEventImpl event = new PrintConversionEventImpl(ValidationEvent.FATAL_ERROR, pMsg, locator); if (handler.handleEvent(event)) { return; } } throw new SAXException(pMsg, pException); } }