use of com.helger.commons.error.SingleError.SingleErrorBuilder in project ph-schematron by phax.
the class AbstractCollectingPSErrorHandler method handle.
@Override
protected void handle(@Nullable final IReadableResource aRes, @Nonnull final IErrorLevel aErrorLevel, @Nullable final IPSElement aSourceElement, @Nonnull final String sMessage, @Nullable final Throwable t) {
final SingleErrorBuilder aBuilder = SingleError.builder().setErrorLevel(aErrorLevel).setErrorLocation(aRes == null ? null : new SimpleLocation(aRes.getResourceID())).setErrorText(sMessage).setLinkedException(t);
if (aSourceElement != null) {
String sField = ClassHelper.getClassLocalName(aSourceElement);
if (aSourceElement instanceof IPSHasID && ((IPSHasID) aSourceElement).hasID())
sField += " [ID=" + ((IPSHasID) aSourceElement).getID() + "]";
aBuilder.setErrorFieldName(sField);
}
m_aErrorList.add(aBuilder.build());
}
Aggregations