Examples of ValidationEventImpl


Examples of javax.xml.bind.helpers.ValidationEventImpl

     * Reports that the type of an object in a property is unexpected. 
     */
    public static void handleTypeMismatchError( XMLSerializer serializer,
            Object parentObject, String fieldName, Object childObject ) throws AbortSerializationException {
       
         ValidationEvent ve = new ValidationEventImpl(
            ValidationEvent.ERROR, // maybe it should be a fatal error.
            Messages.format(Messages.ERR_TYPE_MISMATCH,
                getUserFriendlyTypeName(parentObject),
                fieldName,
                getUserFriendlyTypeName(childObject) ),
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

     * Reports an error to the application.
     */
    public void reportEvent(ValidatableObject source, String formattedMessage) throws AbortSerializationException {
        reportEvent(
            source,
            new ValidationEventImpl( ValidationEvent.ERROR,
                                     formattedMessage,
                                     new ValidationEventLocatorImpl(source) ) );
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

     * This version should be used when an exception is thrown from sub-modules.
     */
    public void reportEvent(ValidatableObject source, Exception nestedException ) throws AbortSerializationException {
        reportEvent(
            source,
            new ValidationEventImpl( ValidationEvent.ERROR,
                                     nestedException.toString(),
                                     new ValidationEventLocatorImpl(source),
                                     nestedException ) );
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

     * Reports an error to the application.
     */
    public void reportEvent(ValidatableObject source, String formattedMessage) throws AbortSerializationException {
        reportEvent(
            source,
            new ValidationEventImpl( ValidationEvent.ERROR,
                                     formattedMessage,
                                     new ValidationEventLocatorImpl(source) ) );
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

     * This version should be used when an exception is thrown from sub-modules.
     */
    public void reportEvent(ValidatableObject source, Exception nestedException ) throws AbortSerializationException {
        reportEvent(
            source,
            new ValidationEventImpl( ValidationEvent.ERROR,
                                     nestedException.toString(),
                                     new ValidationEventLocatorImpl(source),
                                     nestedException ) );
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

    }
    private void reportError( String msg, boolean canRecover ) throws SAXException {
        reportError( msg, null, canRecover );
    }
    private void reportError( String msg, Exception nested, boolean canRecover ) throws SAXException {
        context.handleEvent( new ValidationEventImpl(
            canRecover? ValidationEvent.ERROR : ValidationEvent.FATAL_ERROR,
            msg,
            new ValidationEventLocatorImpl(context.getLocator()),
            nested ), canRecover );
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

     * Reports that the type of an object in a property is unexpected. 
     */
    public static void handleTypeMismatchError( XMLSerializer serializer,
            Object parentObject, String fieldName, Object childObject ) throws AbortSerializationException {
       
         ValidationEvent ve = new ValidationEventImpl(
            ValidationEvent.ERROR, // maybe it should be a fatal error.
            Messages.format(Messages.ERR_TYPE_MISMATCH,
                getUserFriendlyTypeName(parentObject),
                fieldName,
                getUserFriendlyTypeName(childObject) ),
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

        //     sax exception, dom locators keep a reference to their DOMScanner
        //     and call back to figure out where the error occurred.
        ValidationEventLocator vel =
            locator.getLocation( saxException );

        ValidationEventImpl ve =
            new ValidationEventImpl( severity, saxException.getMessage(), vel  );

        Exception e = saxException.getException();
        if( e != null ) {
            ve.setLinkedException( e );
        } else {
            ve.setLinkedException( saxException );
        }
       
        // call the client's event handler.
        host.handleEvent( ve, severity!=ValidationEvent.FATAL_ERROR );
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

            error(e);
        }
    }
   
    private void error( SAXException e ) throws SAXException {
        context.handleEvent(new ValidationEventImpl(
            ValidationEvent.ERROR,
            e.getMessage(),
            new ValidationEventLocatorImpl(context.getLocator()),
            e
        ), false);
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

            if (beanClass.isAnnotationPresent(XmlRootElement.class)) {
                message = Messages.UNABLE_TO_MARSHAL_UNBOUND_CLASS.format(beanClass.getName());
            } else {
                message = Messages.UNABLE_TO_MARSHAL_NON_ELEMENT.format(beanClass.getName());
            }
            target.reportError(new ValidationEventImpl(ValidationEvent.ERROR,message,null, null));
        } else {
            target.startElement(tagName,bean);
            target.childAsSoleContent(bean,null);
            target.endElement();
            if (retainPropertyInfo) {
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.