Package javax.xml.bind

Examples of javax.xml.bind.ValidationEventLocator


       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


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

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

 
    public boolean handleEvent(ValidationEvent ve) {           
      if (ve.getSeverity()==ValidationEvent.FATAL_ERROR
       || ve.getSeverity()==ValidationEvent.ERROR){
       
          ValidationEventLocator  locator = ve.getLocator();
         
          //print message from validation event
          if (log.isDebugEnabled() || ve.getMessage().length() < 120 ) {
            log.warn( printSeverity(ve) + ": " + ve.getMessage() );
          } else {
View Full Code Here

        return retVal;
    }

    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 ").append(line);
                if(url != null) {
                    msg.append(" of ").append(url);
                }
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

            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

    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

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.