Package javax.xml.bind

Examples of javax.xml.bind.ValidationEventHandler.handleEvent()


            handler = owner.getEventHandler();
        } catch( JAXBException e ) {
            throw new AbortSerializationException(e);
        }
       
        if(!handler.handleEvent(ve))
            throw new AbortSerializationException(ve.getMessage());
    }
   
   
    // TODO: probably we should have WrappedSAXException here,
View Full Code Here


            handler = marshaller.getEventHandler();
        } catch( JAXBException e ) {
            throw new SAXException2(e);
        }

        if(!handler.handleEvent(ve)) {
            if(ve.getLinkedException() instanceof Exception)
                throw new SAXException2((Exception)ve.getLinkedException());
            else
                throw new SAXException2(ve.getMessage());
        }
View Full Code Here

            cycle.add(bean);
            String message = "Marshal cycle detected " + cycle;
            if (marshaller != null) {
                ValidationEventHandler validationEventHandler = marshaller.getEventHandler();
                if (validationEventHandler != null) {
                    validationEventHandler.handleEvent(new ValidationEventImpl(ValidationEvent.FATAL_ERROR, message, new ValidationEventLocatorImpl(bean, null)));
                }
            }
            throw new UnmarshalException(message);

        }
View Full Code Here

        if (marshaller != null) {
            validationEventHandler = marshaller.getEventHandler();
        } else if (unmarshaller != null) {
            validationEventHandler = unmarshaller.getEventHandler();
        }
        if (validationEventHandler == null || !validationEventHandler.handleEvent(new ValidationEventImpl(ValidationEvent.ERROR, message, locator, cause))) {
            throw new UnmarshalException(message, cause);
        }
    }
}
View Full Code Here

        } catch( JAXBException e ) {
            // impossible.
            throw new JAXBAssertionError();
        }

        boolean recover = eventHandler.handleEvent(event);
       
        // if the handler says "abort", we will not return the object
        // from the unmarshaller.getResult()
        if(!recover)    aborted = true;
       
View Full Code Here

     * 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;

View Full Code Here

            handler = owner.getEventHandler();
        } catch( JAXBException e ) {
            throw new AbortSerializationException(e);
        }
       
        if(!handler.handleEvent(ve)) {
            if(ve.getLinkedException() instanceof Exception)
                throw new AbortSerializationException((Exception)ve.getLinkedException());
            else
                throw new AbortSerializationException(ve.getMessage());
        }
View Full Code Here

     * 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;

View Full Code Here

            handler = marshaller.getEventHandler();
        } catch( JAXBException e ) {
            throw new SAXException2(e);
        }

        if(!handler.handleEvent(ve)) {
            if(ve.getLinkedException() instanceof Exception)
                throw new SAXException2((Exception)ve.getLinkedException());
            else
                throw new SAXException2(ve.getMessage());
        }
View Full Code Here

            handler = marshaller.getEventHandler();
        } catch( JAXBException e ) {
            throw new SAXException2(e);
        }

        if(!handler.handleEvent(ve)) {
            if(ve.getLinkedException() instanceof Exception)
                throw new SAXException2((Exception)ve.getLinkedException());
            else
                throw new SAXException2(ve.getMessage());
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.