/** * Returns true if an event handler is installed. * <p> * The default handler ignores any errors, and for that this method returns false. */ public final boolean hasEventHandler() { return getEventHandler()!=this; }
public ValidationEventHandler getEventHandler() { return getUnmarshaller().getEventHandler(); }
@Override public boolean handleEvent(ValidationEvent event) { try { // if the handler says "abort", we will not return the object. boolean recover = parent.getEventHandler().handleEvent(event); if(!recover) aborted = true; return recover; } catch( RuntimeException re ) { // if client event handler causes a runtime exception, then we // have to return false. return false; } }
public void startElement(TagName tagName) throws SAXException { if(tagName.local.equals("Include") && tagName.uri.equals(WellKnownNamespace.XOP)) { // found xop:Include String href = tagName.atts.getValue("href"); DataHandler attachment = au.getAttachmentAsDataHandler(href); if(attachment==null) { // report an error and ignore parent.getEventHandler().handleEvent(null); // TODO } base64data.set(attachment); next.text(base64data); inXopInclude = true; followXop = true; } else next.startElement(tagName); }
/** * Returns true if an event handler is installed. * <p> * The default handler ignores any errors, and for that this method returns false. */ public final boolean hasEventHandler() { return getEventHandler()!=this; }
/** * Reports an error to the user, and asks if s/he wants * to recover. If the canRecover flag is false, regardless * of the client instruction, an exception will be thrown. * * Only if the flag is true and the user wants to recover from an error, * the method returns normally. * * The thrown exception will be catched by the unmarshaller. */ public void handleEvent(ValidationEvent event, boolean canRecover ) throws SAXException { ValidationEventHandler eventHandler = parent.getEventHandler(); boolean recover = eventHandler.handleEvent(event); // if the handler says "abort", we will not return the object // from the unmarshaller.getResult() if(!recover) aborted = true; if( !canRecover || !recover ) throw new SAXParseException2( event.getMessage(), locator, new UnmarshalException( event.getMessage(), event.getLinkedException() ) ); }
@Override public boolean handleEvent(ValidationEvent event) { try { // if the handler says "abort", we will not return the object. boolean recover = parent.getEventHandler().handleEvent(event); if(!recover) aborted = true; return recover; } catch( RuntimeException re ) { // if client event handler causes a runtime exception, then we // have to return false. return false; } }
public ValidationEventHandler getEventHandler() { return getUnmarshaller().getEventHandler(); }
public void startElement(TagName tagName) throws SAXException { if(tagName.local.equals("Include") && tagName.uri.equals(WellKnownNamespace.XOP)) { // found xop:Include String href = tagName.atts.getValue("href"); DataHandler attachment = au.getAttachmentAsDataHandler(href); if(attachment==null) { // report an error and ignore parent.getEventHandler().handleEvent(null); // TODO } base64data.set(attachment); next.text(base64data); inXopInclude = true; followXop = true; } else next.startElement(tagName); }
/** * Returns true if an event handler is installed. * <p> * The default handler ignores any errors, and for that this method returns false. */ public final boolean hasEventHandler() { return getEventHandler()!=this; }
/** * Reports an error to the user, and asks if s/he wants * to recover. If the canRecover flag is false, regardless * of the client instruction, an exception will be thrown. * * Only if the flag is true and the user wants to recover from an error, * the method returns normally. * * The thrown exception will be catched by the unmarshaller. */ public void handleEvent(ValidationEvent event, boolean canRecover ) throws SAXException { ValidationEventHandler eventHandler = parent.getEventHandler(); boolean recover = eventHandler.handleEvent(event); // if the handler says "abort", we will not return the object // from the unmarshaller.getResult() if(!recover) aborted = true; if( !canRecover || !recover ) throw new SAXParseException2( event.getMessage(), locator, new UnmarshalException( event.getMessage(), event.getLinkedException() ) ); }
/** * Returns true if an event handler is installed. * <p> * The default handler ignores any errors, and for that this method returns false. */ public final boolean hasEventHandler() { return getEventHandler()!=this; }
public ValidationEventHandler getEventHandler() { return getUnmarshaller().getEventHandler(); }
@Override public boolean handleEvent(ValidationEvent event) { try { // if the handler says "abort", we will not return the object. boolean recover = parent.getEventHandler().handleEvent(event); if(!recover) aborted = true; return recover; } catch( RuntimeException re ) { // if client event handler causes a runtime exception, then we // have to return false. return false; } }
@Override public boolean handleEvent(ValidationEvent event) { try { // if the handler says "abort", we will not return the object. boolean recover = parent.getEventHandler().handleEvent(event); if(!recover) aborted = true; return recover; } catch( RuntimeException re ) { // if client event handler causes a runtime exception, then we // have to return false. return false; } }
public ValidationEventHandler getEventHandler() { return getUnmarshaller().getEventHandler(); }
public void startElement(TagName tagName) throws SAXException { if(tagName.local.equals("Include") && tagName.uri.equals(WellKnownNamespace.XOP)) { // found xop:Include String href = tagName.atts.getValue("href"); DataHandler attachment = au.getAttachmentAsDataHandler(href); if(attachment==null) { // report an error and ignore parent.getEventHandler().handleEvent(null); // TODO } base64data.set(attachment); next.text(base64data); inXopInclude = true; followXop = true; } else next.startElement(tagName); }
public void startElement(TagName tagName) throws SAXException { if(tagName.local.equals("Include") && tagName.uri.equals(WellKnownNamespace.XOP)) { // found xop:Include String href = tagName.atts.getValue("href"); DataHandler attachment = au.getAttachmentAsDataHandler(href); if(attachment==null) { // report an error and ignore parent.getEventHandler().handleEvent(null); // TODO } base64data.set(attachment); next.text(base64data); inXopInclude = true; followXop = true; } else next.startElement(tagName); }
/** * Reports an error to the user, and asks if s/he wants * to recover. If the canRecover flag is false, regardless * of the client instruction, an exception will be thrown. * * Only if the flag is true and the user wants to recover from an error, * the method returns normally. * * The thrown exception will be catched by the unmarshaller. */ public void handleEvent(ValidationEvent event, boolean canRecover ) throws SAXException { ValidationEventHandler eventHandler = parent.getEventHandler(); boolean recover = eventHandler.handleEvent(event); // if the handler says "abort", we will not return the object // from the unmarshaller.getResult() if(!recover) aborted = true; if( !canRecover || !recover ) throw new SAXParseException2( event.getMessage(), locator, new UnmarshalException( event.getMessage(), event.getLinkedException() ) ); }
/** * Reports an error to the user, and asks if s/he wants * to recover. If the canRecover flag is false, regardless * of the client instruction, an exception will be thrown. * * Only if the flag is true and the user wants to recover from an error, * the method returns normally. * * The thrown exception will be catched by the unmarshaller. */ public void handleEvent(ValidationEvent event, boolean canRecover ) throws SAXException { ValidationEventHandler eventHandler = parent.getEventHandler(); boolean recover = eventHandler.handleEvent(event); // if the handler says "abort", we will not return the object // from the unmarshaller.getResult() if(!recover) aborted = true; if( !canRecover || !recover ) throw new SAXParseException2( event.getMessage(), locator, new UnmarshalException( event.getMessage(), event.getLinkedException() ) ); }