Package javax.xml.bind.helpers

Examples of javax.xml.bind.helpers.ValidationEventLocatorImpl


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


    public void fatalError(SAXParseException exception) throws SAXException {
        handleException(exception, ValidationEvent.FATAL_ERROR);
    }

    private void handleException(SAXParseException exception, int severity) throws SAXException {
        ValidationEventLocatorImpl eventLocator = new ValidationEventLocatorImpl(exception);
        if(exception instanceof MarshalSAXParseException) {
            eventLocator.setObject(((MarshalSAXParseException) exception).getObject());
        }
        ValidationEvent event = new ValidationEventImpl(severity, exception.getLocalizedMessage(), eventLocator, exception);
        if (!eventHandler.handleEvent(event)) {
            throw exception;
        }
View Full Code Here

        idReferencedObjects.add(obj);
        if(id==null) {
            reportError( new NotIdentifiableEventImpl(
                ValidationEvent.ERROR,
                Messages.NOT_IDENTIFIABLE.format(),
                new ValidationEventLocatorImpl(obj) ) );
        }
        return id;
    }
View Full Code Here

            try {
                String id = getIdFromObject(idObj);
                reportError( new NotIdentifiableEventImpl(
                    ValidationEvent.ERROR,
                    Messages.DANGLING_IDREF.format(id),
                    new ValidationEventLocatorImpl(idObj) ) );
            } catch (JAXBException e) {
                // this error should have been reported already. just ignore here.
            }
        }
View Full Code Here

     */
    public void errorMissingId(Object obj) throws SAXException {
        reportError( new ValidationEventImpl(
            ValidationEvent.ERROR,
            Messages.MISSING_ID.format(obj),
            new ValidationEventLocatorImpl(obj)) );
    }
View Full Code Here

    public String getSystemId() { return null; }
    public int getLineNumber() { return -1; }
    public int getColumnNumber() { return -1; }

    public ValidationEventLocator getLocation() {
        return new ValidationEventLocatorImpl(getCurrentLocation());
    }
View Full Code Here

  }

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

    handleEvent(event, pException);
  }

  private void handleEvent(ValidationEventImpl pEvent, Exception pException) throws SAXException {
    if (locator != null) {
      pEvent.setLocator(new ValidationEventLocatorImpl(locator));
    }
    if (pException != null) {
      pEvent.setLinkedException(pException);
    }
    ValidationEventHandler eventHandler;
View Full Code Here

  }

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

    handleEvent(event, pException);
  }

  private void handleEvent(ValidationEventImpl pEvent, Exception pException) throws SAXException {
    if (locator != null) {
      pEvent.setLocator(new ValidationEventLocatorImpl(locator));
    }
    if (pException != null) {
      pEvent.setLinkedException(pException);
    }
    ValidationEventHandler eventHandler;
View Full Code Here

TOP

Related Classes of javax.xml.bind.helpers.ValidationEventLocatorImpl

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.