Package javax.xml.bind

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


  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);
  }
View Full Code Here


    try {
      eventHandler = unmarshaller.getEventHandler();
    } catch (JAXBException e) {
      throw new SAXException(e);
    }
    if (eventHandler == null  ||  !eventHandler.handleEvent(pEvent)) {
      String msg = pEvent.getMessage();
      if (pEvent instanceof org.apache.ws.jaxme.impl.ValidationEventImpl) {
        String errorCode = ((org.apache.ws.jaxme.impl.ValidationEventImpl) pEvent).getErrorCode();
        if (errorCode != null) {
          msg = errorCode + ": " + msg;
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

        } 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

            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

            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

        } 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

    try {
      eventHandler = unmarshaller.getEventHandler();
    } catch (JAXBException e) {
      throw new SAXException(e);
    }
    if (eventHandler == null  ||  !eventHandler.handleEvent(pEvent)) {
      String msg = pEvent.getMessage();
      if (pEvent instanceof org.apache.ws.jaxme.impl.ValidationEventImpl) {
        String errorCode = ((org.apache.ws.jaxme.impl.ValidationEventImpl) pEvent).getErrorCode();
        if (errorCode != null) {
          msg = errorCode + ": " + msg;
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.