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


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

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

/*  68 */       this.columnNumber = loc.getColumnNumber();
/*  69 */       this.lineNumber = loc.getLineNumber();
/*  70 */       this.systemId = loc.getSystemId();
/*  71 */       this.publicId = loc.getPublicId();
/*     */
/*  73 */       ValidationEventLocator vel = loc.getLocation();
/*  74 */       this.offset = vel.getOffset();
/*  75 */       this.url = vel.getURL();
/*  76 */       this.object = vel.getObject();
/*  77 */       this.node = vel.getNode();
/*     */     }
View Full Code Here

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

       throw new SAXException(e);
    }
    if (eventHandler == null) {
      throw new SAXParseException(pMsg, getDocumentLocator());
    } else {
      ValidationEventLocator myLocator = new ValidationEventLocatorImpl(getDocumentLocator());
      ValidationEventImpl event = new ValidationEventImpl(pSeverity,
                                                          pErrorCode + ": " + pMsg,
                                                          myLocator);
      event.setErrorCode(pErrorCode);
      eventHandler.handleEvent(event);
View Full Code Here

       throw new SAXException(e);
    }
    if (eventHandler == null) {
      throw new SAXParseException(pMsg, getDocumentLocator(), pException);
    } else {
      ValidationEventLocator myLocator = new ValidationEventLocatorImpl(getDocumentLocator());
      ValidationEventImpl event = new ValidationEventImpl(pSeverity,
                                                          pErrorCode + ": " + pMsg,
                                                          myLocator,
                                                          pException);
      event.setErrorCode(pErrorCode);
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

            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.