Package javax.xml.bind

Examples of javax.xml.bind.ValidationEventLocator


        super();
        eventHandler = validationEventHandler;
    }

    public void warning(SAXParseException exception) throws SAXException {
        ValidationEventLocator eventLocator = new ValidationEventLocatorImpl(exception);
        ValidationEvent event = new ValidationEventImpl(ValidationEvent.WARNING, null, eventLocator, exception);
        if (!eventHandler.handleEvent(event)) {
            throw exception;
        }
    }
View Full Code Here


            throw exception;
        }
    }

    public void error(SAXParseException exception) throws SAXException {
        ValidationEventLocator eventLocator = new ValidationEventLocatorImpl(exception);
        ValidationEvent event = new ValidationEventImpl(ValidationEvent.ERROR, null, eventLocator, exception);
        if (!eventHandler.handleEvent(event)) {
            throw exception;
        }
    }
View Full Code Here

            throw exception;
        }
    }

    public void fatalError(SAXParseException exception) throws SAXException {
        ValidationEventLocator eventLocator = new ValidationEventLocatorImpl(exception);
        ValidationEvent event = new ValidationEventImpl(ValidationEvent.FATAL_ERROR, null, eventLocator, exception);
        if (!eventHandler.handleEvent(event)) {
            throw exception;
        }
    }
View Full Code Here

            columnNumber = loc.getColumnNumber();
            lineNumber = loc.getLineNumber();
            systemId = loc.getSystemId();
            publicId = loc.getPublicId();

            ValidationEventLocator vel = loc.getLocation();
            offset = vel.getOffset();
            url = vel.getURL();
            object = vel.getObject();
            node = vel.getNode();
        }
View Full Code Here

                        new ValidationEventHandler() {
                            // allow unmarshalling to continue even if there are errors
                            public boolean handleEvent(ValidationEvent ve) {
                                // ignore warnings
                                if (ve.getSeverity() != ValidationEvent.WARNING) {
                                    ValidationEventLocator vel = ve.getLocator();
                                    System.out.println(
                                            "Line:Col[" + vel.getLineNumber()
                                            + ":" + vel.getColumnNumber()
                                            + "]:" + ve.getMessage());
                                }

                                return true;
                            }
View Full Code Here

    private int columnNumber;
    private String message;

    @Override
    public boolean handleEvent(ValidationEvent validationEvent) {
      ValidationEventLocator locator = validationEvent.getLocator();
      lineNumber = locator.getLineNumber();
      columnNumber = locator.getColumnNumber();
      message = validationEvent.getMessage();
      return false;
    }
View Full Code Here

     *
     */
    private String getLocation(ValidationEvent event) {
        StringBuffer msg = new StringBuffer();
       
        ValidationEventLocator locator = event.getLocator();
       
        if( locator != null ) {
           
            URL url = locator.getURL();
            Object obj = locator.getObject();
            Node node = locator.getNode();
            int line = locator.getLineNumber();
           
            if( url!=null || line!=-1 ) {
                msg.append( "line " + line );
                if( url!=null )
                    msg.append( " of " + url );
View Full Code Here

    private int columnNumber;
    private String message;

    @Override
    public boolean handleEvent(ValidationEvent validationEvent) {
      ValidationEventLocator locator = validationEvent.getLocator();
      lineNumber = locator.getLineNumber();
      columnNumber = locator.getColumnNumber();
      message = validationEvent.getMessage();
      return false;
    }
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

  }

  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

TOP

Related Classes of javax.xml.bind.ValidationEventLocator

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.