Java Code Examples for javax.xml.bind.ValidationEventLocator#getURL()

The following examples show how to use javax.xml.bind.ValidationEventLocator#getURL() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocatorEx.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Snapshot(LocatorEx loc) {
    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();
}
 
Example 2
Source File: LocatorEx.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Snapshot(LocatorEx loc) {
    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();
}
 
Example 3
Source File: DefaultValidationEventHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 4
Source File: LocatorEx.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Snapshot(LocatorEx loc) {
    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();
}
 
Example 5
Source File: DefaultValidationEventHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 6
Source File: LocatorEx.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Snapshot(LocatorEx loc) {
    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();
}
 
Example 7
Source File: DefaultValidationEventHandler.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 8
Source File: DefaultValidationEventHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 9
Source File: LocatorEx.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Snapshot(LocatorEx loc) {
    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();
}
 
Example 10
Source File: DefaultValidationEventHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 11
Source File: DefaultValidationEventHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 12
Source File: DefaultValidationEventHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 13
Source File: LocatorEx.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Snapshot(LocatorEx loc) {
    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();
}
 
Example 14
Source File: DefaultValidationEventHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 15
Source File: DefaultValidationEventHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 16
Source File: LocatorEx.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Snapshot(LocatorEx loc) {
    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();
}
 
Example 17
Source File: AbstractValidationEventHandler.java    From ph-commons with Apache License 2.0 5 votes vote down vote up
@Nullable
@OverrideOnDemand
protected String getLocationResourceID (@Nullable final ValidationEventLocator aLocator)
{
  if (aLocator != null)
  {
    // Source file found?
    final URL aURL = aLocator.getURL ();
    if (aURL != null)
      return aURL.toString ();
  }
  return null;
}
 
Example 18
Source File: XmlBindingTool.java    From freehealth-connector with GNU Affero General Public License v3.0 5 votes vote down vote up
private String getLocationDescription(ValidationEvent event) {
   ValidationEventLocator locator = event.getLocator();
   if (locator == null) {
      return "XML with location unavailable";
   } else {
      StringBuffer msg = new StringBuffer();
      URL url = locator.getURL();
      Object obj = locator.getObject();
      Node node = locator.getNode();
      int line = locator.getLineNumber();
      if (url == null && line == -1) {
         if (obj != null) {
            msg.append("obj: ");
            msg.append(obj);
         } else if (node != null) {
            msg.append("node: ");
            msg.append(node);
         }
      } else {
         msg.append("line ");
         msg.append(line);
         if (url != null) {
            msg.append(" of ");
            msg.append(url);
         }
      }

      return msg.toString();
   }
}
 
Example 19
Source File: DefaultValidationEventHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Calculate a location message for the event
 *
 */
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 );
        } else if( obj != null ) {
            msg.append( " obj: " + obj.toString() );
        } else if( node != null ) {
            msg.append( " node: " + node.toString() );
        }
    } else {
        msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
    }

    return msg.toString();
}
 
Example 20
Source File: LocatorEx.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Snapshot(LocatorEx loc) {
    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();
}