Java Code Examples for javax.xml.bind.ValidationEventLocator#getObject()
The following examples show how to use
javax.xml.bind.ValidationEventLocator#getObject() .
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: AbstractValidationEventHandler.java From ph-commons with Apache License 2.0 | 6 votes |
@Nullable @OverrideOnDemand protected String getErrorFieldName (@Nullable final ValidationEventLocator aLocator) { if (aLocator != null) { // Source object found? final Object aObj = aLocator.getObject (); if (aObj != null) return "obj: " + aObj.toString (); // Source node found? final Node aNode = aLocator.getNode (); if (aNode != null) return XMLWriter.getNodeAsString (aNode); } return null; }
Example 2
Source File: LocatorEx.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
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: LocatorEx.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
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 4
Source File: DefaultValidationEventHandler.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * 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 5
Source File: LocatorEx.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
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 6
Source File: DefaultValidationEventHandler.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * 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 7
Source File: LocatorEx.java From hottub with GNU General Public License v2.0 | 5 votes |
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 8
Source File: DefaultValidationEventHandler.java From Java8CN with Apache License 2.0 | 5 votes |
/** * 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: DefaultValidationEventHandler.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * 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 10
Source File: LocatorEx.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
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 11
Source File: DefaultValidationEventHandler.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * 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 jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * 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: DefaultValidationEventHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * 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 14
Source File: LocatorEx.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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 15
Source File: DefaultValidationEventHandler.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * 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: DefaultValidationEventHandler.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * 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 17
Source File: LocatorEx.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
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 18
Source File: XmlBindingTool.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
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 openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * 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 |
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(); }