Package javax.xml.bind

Examples of javax.xml.bind.ValidationEvent


            // assume this exception is not from application.
            // (e.g., when a marshaller aborts the processing, this exception
            //        will be thrown)
            throw (SAXException)e;

        ValidationEvent ve = new PrintConversionEventImpl(
            ValidationEvent.ERROR, e.getMessage(),
            new ValidationEventLocatorImpl(caller), e );
        serializer.reportError(ve);
    }
View Full Code Here


     * 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 SAXException {

         ValidationEvent ve = new ValidationEventImpl(
            ValidationEvent.ERROR, // maybe it should be a fatal error.
             Messages.TYPE_MISMATCH.format(
                getTypeName(parentObject),
                fieldName,
                getTypeName(childObject) ),
View Full Code Here

  public boolean checkOrder(int order, ValidationEventHandler handler)
  {
    if (_order < 0 || _order == order)
      return true;

    ValidationEvent event =
      new ValidationEventImpl(ValidationEvent.ERROR,
                              L.l("ordering error"),
                              new ValidationEventLocatorImpl());

    return handler.handleEvent(event);
View Full Code Here

            // assume this exception is not from application.
            // (e.g., when a marshaller aborts the processing, this exception
            //        will be thrown)
            throw (SAXException)e;
       
        ValidationEvent ve = new PrintConversionEventImpl(
            ValidationEvent.ERROR, e.getMessage(),
            new ValidationEventLocatorImpl(caller) );
        serializer.reportError(ve);
    }
View Full Code Here

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

    // 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

            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

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

Related Classes of javax.xml.bind.ValidationEvent

Copyright © 2018 www.massapicom. 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.