/** * Utility method to convert a {@link SAXParseException} into an * {@link IResourceError}. * * @param eErrorLevel * The occurred error level. May not be <code>null</code>. * @param ex * The exception to convert. May not be <code>null</code>. * @return The {@link IResourceError} representation. Never <code>null</code>. */ @Nonnull public static IResourceError getSaxParseError (@Nonnull final EErrorLevel eErrorLevel, @Nonnull final SAXParseException ex) { final String sResourceID = StringHelper.getConcatenatedOnDemand (ex.getPublicId (), "/", ex.getSystemId ()); final IResourceLocation aLocation = new ResourceLocation (sResourceID, ex.getLineNumber (), ex.getColumnNumber ()); return new ResourceError (aLocation, eErrorLevel, "[SAX] " + ex.getMessage ()); }
@Override @Nonnull public String getPlainText () { return StringHelper.getConcatenatedOnDemand (getHead ().getPlainText (), " ", getBody ().getPlainText ()); }
@Nonnull private static IResourceError _buildError (@Nonnull final TransformerException ex, @Nonnull final EErrorLevel eErrorLevel, @Nonnull final IHasDisplayText aErrorMsg) { final SourceLocator aLocator = ex.getLocator (); final IResourceLocation aLocation = aLocator != null ? new ResourceLocation (StringHelper.getConcatenatedOnDemand (aLocator.getPublicId (), "/", aLocator.getSystemId ()), aLocator.getLineNumber (), aLocator.getColumnNumber ()) : new ResourceLocation (ex.getLocationAsString ()); return new ResourceError (aLocation, eErrorLevel, aErrorMsg, ex); }
if (aObjStart[2] != null) sValue = StringHelper.getConcatenatedOnDemand (aObjStart[0], aObjStart[2]).trim (); if (sValue.length () > 0)