public SdcctLocation(@Nullable DOMLocator domLocator) { this(); if (domLocator != null) { this.initializeNode(domLocator.getRelatedNode()); } }
private void initializeSourceLocator(@Nullable SourceLocator srcLocator) { if (srcLocator == null) { return; } this.colNum = srcLocator.getColumnNumber(); this.lineNum = srcLocator.getLineNumber(); this.publicId = srcLocator.getPublicId(); this.sysId = srcLocator.getSystemId(); if (srcLocator instanceof javax.xml.transform.dom.DOMLocator) { this.initializeNode(((javax.xml.transform.dom.DOMLocator) srcLocator).getOriginatingNode()); } }
public DOMLocatorImpl(DOMLocator src) { this.lineNumber = src.getLineNumber(); this.columnNumber = src.getColumnNumber(); this.byteOffset = src.getByteOffset(); this.utf16Offset = src.getUtf16Offset(); this.relatedNode = src.getRelatedNode(); this.uri = src.getUri(); }
void throwExceptionIfHasError() { if (exception != null) throw new ConverterException(exception); if (error != null) { if (error.getRelatedException() instanceof Throwable) throw new ConverterException((Throwable) error.getRelatedException()); DOMLocator locator = error.getLocation(); String location = "at:" + locator.getUri() + ", line:" + locator.getLineNumber() + ", char:" + locator.getColumnNumber(); throw new ConverterException(location + " " + error.getMessage()); } }
/** * The location of the error. */ public DOMLocator getLocation() { return fLocator; }
/** Prints the error message. */ private void printError(DOMError error) { int severity = error.getSeverity(); fOut.print("["); if ( severity == DOMError.SEVERITY_WARNING) { fOut.print("Warning"); } else if ( severity == DOMError.SEVERITY_ERROR) { fOut.print("Error"); } else { fOut.print("FatalError"); eStatus = false ; //REVISIT: Abort processing if fatal error, do we need to?? } fOut.print("] "); DOMLocator locator = error.getLocation(); if (locator != null) { fOut.print(locator.getLineNumber()); fOut.print(":"); fOut.print(locator.getColumnNumber()); fOut.print(":"); fOut.print(locator.getByteOffset()); fOut.print(","); fOut.print(locator.getUtf16Offset()); Node node = locator.getRelatedNode(); if (node != null) { fOut.print("["); fOut.print(node.getNodeName()); fOut.print("]"); } String systemId = locator.getUri(); if (systemId != null) { int index = systemId.lastIndexOf('/'); if (index != -1) systemId = systemId.substring(index + 1); fOut.print(": "); fOut.print(systemId); } } fOut.print(":"); fOut.print(error.getMessage()); fOut.println(); fOut.flush(); }
public DOMLocator getLocation() { if (domLocator == null) { domLocator = new ErrorLocation(relatedNode); } return domLocator; }
public DOMLocator getLocation() { return NULL_DOM_LOCATOR; }
public final DOMLocator getLocation() { return location; }
/** * The location of the DOMError. * * @return A DOMLocator object containing the DOMError location. */ public DOMLocator getLocation() { return fLocation; }