Package javax.xml.bind

Examples of javax.xml.bind.ValidationEventLocator


    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

public class AltdatenValidationEventHandler implements ValidationEventHandler{

  public boolean handleEvent(ValidationEvent ve) {
   
    if(ve.getSeverity()==ValidationEvent.FATAL_ERROR || ve.getSeverity()==ValidationEvent.ERROR){
      ValidationEventLocator locator = ve.getLocator();
      System.out.println("Falsches Archivaliendocument: "+locator.getURL());
      System.out.println("Fehler: "+ve.getMessage());
      System.out.println("Fehler in der Zeile "+locator.getColumnNumber() +", an der Stelle "+locator.getLineNumber());
    }
    return true;
  }
View Full Code Here

           
        // get location info:
        //     sax locators simply use the location info embedded in the
        //     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  );
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

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.