Refine search
@Override public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException { log.warn("Error:" + errorType + ", " + message + " at line " + location.getLineNumber() + ", col " + location.getColumnNumber()); } })
public static void addXMLLocation(BaseElement element, XMLStreamReader xtr) { Location location = xtr.getLocation(); element.setXmlRowNumber(location.getLineNumber()); element.setXmlColumnNumber(location.getColumnNumber()); }
public static void addXMLLocation(GraphicInfo graphicInfo, XMLStreamReader xtr) { Location location = xtr.getLocation(); graphicInfo.setXmlRowNumber(location.getLineNumber()); graphicInfo.setXmlColumnNumber(location.getColumnNumber()); }
/** * Construct a new instance. * * @param uri the file name (may be {@code null} if this location does not correspond to a file) * @param original the location to copy the remainder of the information from */ XMLLocation(final URI uri, final Location original) { this(uri, original.getLineNumber(), original.getColumnNumber(), original.getCharacterOffset(), original.getPublicId(), original.getSystemId()); }
/** * Construct a new instance. * * @param uri the file name (may be {@code null} if this location does not correspond to a file) * @param original the location to copy the remainder of the information from */ XMLLocation(final XMLLocation includedFrom, final URI uri, final Location original) { this(includedFrom, uri, original.getLineNumber(), original.getColumnNumber(), original.getCharacterOffset(), original.getPublicId(), original.getSystemId()); }
/** * Construct a new instance. * * @param original the location to copy the remainder of the information from */ XMLLocation(final Location original) { this(original instanceof XMLLocation ? ((XMLLocation)original).getUri() : null, original.getLineNumber(), original.getColumnNumber(), original.getCharacterOffset(), original.getPublicId(), original.getSystemId()); }
log.error(e.getMessage() + " at line " + e.getLocation().getLineNumber() + ", col " + e.getLocation().getColumnNumber()); e.getCause().printStackTrace(); List<String> lines = IOUtils.readLines(is); String line = lines.get( e.getLocation().getLineNumber()-1); if (e.getLocation().getColumnNumber()>PRIOR_CHARS) { start = e.getLocation().getColumnNumber() - PRIOR_CHARS; int end = e.getLocation().getColumnNumber() + PRIOR_CHARS; if (end > line.length()-1 ) { end = line.length()-1;
outputRowData[data.pos_xml_location_line] = new Long( e.getLocation().getLineNumber() ); outputRowData[data.pos_xml_location_column] = new Long( e.getLocation().getColumnNumber() );
private TldMetaData parseTLD(Resource tld) throws DeploymentUnitProcessingException { if (IMPLICIT_TLD.equals(tld.getName())) { // Implicit TLDs are different from regular TLDs return new TldMetaData(); } InputStream is = null; try { is = tld.openStream(); final XMLInputFactory inputFactory = XMLInputFactory.newInstance(); inputFactory.setXMLResolver(NoopXMLResolver.create()); XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is); return TldMetaDataParser.parse(xmlReader); } catch (XMLStreamException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(tld.getName(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()), e); } catch (IOException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(tld.getName()), e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { // Ignore } } }
private TldMetaData parseTLD(VirtualFile tld) throws DeploymentUnitProcessingException { if (IMPLICIT_TLD.equals(tld.getName())) { // Implicit TLDs are different from regular TLDs return new TldMetaData(); } InputStream is = null; try { is = tld.openStream(); final XMLInputFactory inputFactory = XMLInputFactory.newInstance(); inputFactory.setXMLResolver(NoopXMLResolver.create()); XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(is); return TldMetaDataParser.parse(xmlReader); } catch (XMLStreamException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(tld.toString(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()), e); } catch (IOException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(tld.toString()), e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { // Ignore } } }
UndertowLogger.ROOT_LOGGER.distributableDisabledInFragmentXml(deploymentUnit.getName(),resourceRoot.getRootName()); } catch (XMLStreamException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(webFragment.toString(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber())); } catch (IOException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(webFragment.toString()), e);
Integer columnNumber = null; if (e.getLocation() != null) { lineNumber = e.getLocation().getLineNumber(); columnNumber = e.getLocation().getColumnNumber();
throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(jbossWebXml.toString(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()), e); } catch (IOException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(jbossWebXml.toString()), e);
@Override public String toString() { return "BodyEvent(" + getText() + ")" + location.getLineNumber() + "," + location.getColumnNumber(); } }
@Override public String toString() { return "StartEvent(" + getName() + ") [" + location.getLineNumber() + "," + location.getColumnNumber() + "]"; } }
public LocationImpl(Location loc) { this.lineNumber = loc.getLineNumber(); this.columnNumber = loc.getColumnNumber(); this.systemId = loc.getSystemId(); }
/** * Returns an XmlError for the given message, located at a specific point in the given file and {@link #SEVERITY_ERROR}. * @param message the error message * @param sourceName the URL or other name for the file * @param location the location from an xml stream */ public static XmlError forLocation(String message, String sourceName, Location location) { return new XmlError(message, (String)null, SEVERITY_ERROR, sourceName, location.getLineNumber(), location.getColumnNumber(), -1, null); }
@Override public String toString() { return "EndEvent("+getName()+") ["+location.getLineNumber()+","+location.getColumnNumber()+"]"; }
/** * Unlike with reader source, we won't start from beginning of a file, * but usually from somewhere in the middle... */ protected void doInitInputLocation(WstxInputData reader) { reader.mCurrInputProcessed = mContentStart.getCharacterOffset(); reader.mCurrInputRow = mContentStart.getLineNumber(); /* 13-Apr-2005, TSa: Since column offsets reported by Location * objects are 1-based, but internally we use 0-based counts, * need to offset this start by 1 to begin with. */ reader.mCurrInputRowStart = -mContentStart.getColumnNumber() + 1; }
private static void lineNumber(XMLStreamReader xsr, LoadContext context) { javax.xml.stream.Location loc = xsr.getLocation(); if (loc != null) { context.lineNumber(loc.getLineNumber(), loc.getColumnNumber(), loc.getCharacterOffset()); } }