Examples of ValidationEventImpl


Examples of javax.xml.bind.helpers.ValidationEventImpl

            buf.append(' ');
        buf.append(text);
    }
   
    private void reportMissingObjectError() throws SAXException {
        ValidationEvent ev = new ValidationEventImpl(
            ValidationEvent.ERROR,
            Messages.format(Messages.MISSING_OBJECT),
            new ValidationEventLocatorImpl(target),
            new NullPointerException() );
   
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

        // If the assertion fails, it must be a bug of xjc.
        // right now, we are not expecting the text method to be called.
        _assert(textBuf!=null);
       
        if(text==null) {
            ValidationEvent ev = new ValidationEventImpl(
                ValidationEvent.ERROR,
                Messages.format(Messages.ERR_MISSING_OBJECT), null,
                new NullPointerException() );
       
            reportError(ev);
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

    // so that we can throw MarshalException directly from this method.
    //
    // TODO: unless we change the method signature of childAsXXXX and take the parent object
    // as one of the parameters, we can't report any location associated with it.
    private void missingObjectError() throws SAXException {
        ValidationEvent ev = new ValidationEventImpl(
            ValidationEvent.ERROR, Messages.format(Messages.ERR_MISSING_OBJECT), null );
       
        reportError(ev);
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

   
    /**
     * Makes a ValidationEvent that holds the same information.
     */
    public ValidationEvent createValidationEvent() {
        return new ValidationEventImpl(
            ValidationEvent.ERROR,
            getMessage(),
            new ValidationEventLocatorImpl( locator ),
            nestedException );
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

     * a JAXB object is missing a required field.
     *
     * @return always returns non-null valid object.
     */
    public static ValidationEvent createMissingObjectError( Object target, String fieldName ) {
        return new ValidationEventImpl(
            ValidationEvent.ERROR,
            Messages.format(Messages.MISSING_OBJECT,fieldName),
            new ValidationEventLocatorExImpl(target,fieldName),
            new NullPointerException() );
    }
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

            error(e);
        }
    }
   
    private void error( SAXException e ) {
        context.handleEvent(new ValidationEventImpl(
            ValidationEvent.ERROR,
            e.getMessage(),
            new ValidationEventLocatorImpl(context.getLocator()),
            e
        ));
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.  If it returns false, then bail-out
        // and terminate the unmarshal operation.
        boolean result;
View Full Code Here

Examples of javax.xml.bind.helpers.ValidationEventImpl

     *
     * @param fieldName
     *      the name of the property being processed when an error is found.
     */
    public final void reportError(String fieldName, Throwable t) throws SAXException {
        ValidationEvent ve = new ValidationEventImpl(ValidationEvent.ERROR,
            t.getMessage(), getCurrentLocation(fieldName), t);
        reportError(ve);
    }
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.