@NotThreadSafe public class ErrorTextProvider extends Object implements IErrorTextProvider, ICloneable<ErrorTextProvider>
IErrorTextProvider with a customizable
layout.| Modifier and Type | Class and Description |
|---|---|
static class |
ErrorTextProvider.EField |
static class |
ErrorTextProvider.FormattableItem
Default placeholder based implementation of
ErrorTextProvider.IFormattableItem. |
static interface |
ErrorTextProvider.IFormattableItem
Base interface for objects that format a single field.
|
| Modifier and Type | Field and Description |
|---|---|
static IErrorTextProvider |
DEFAULT |
static char |
PLACEHOLDER |
static String |
PLACEHOLDER_STR |
| Constructor and Description |
|---|
ErrorTextProvider() |
ErrorTextProvider(ErrorTextProvider aOther)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ErrorTextProvider |
addItem(ErrorTextProvider.EField eField,
String sText)
Add an error item to be disabled.
|
ErrorTextProvider |
addItem(ErrorTextProvider.IFormattableItem aItem) |
ICommonsList<ErrorTextProvider.IFormattableItem> |
getAllItems() |
ErrorTextProvider |
getClone() |
String |
getErrorText(IError aError,
Locale aContentLocale)
Get the provided error as a String
|
String |
getFieldSeparator() |
ErrorTextProvider |
setFieldSeparator(String sFieldSep) |
String |
toString() |
public static final char PLACEHOLDER
public static final String PLACEHOLDER_STR
public static final IErrorTextProvider DEFAULT
public ErrorTextProvider()
public ErrorTextProvider(@Nonnull ErrorTextProvider aOther)
aOther - Object to copy from. May not be null.@Nonnull @ReturnsMutableCopy public ICommonsList<ErrorTextProvider.IFormattableItem> getAllItems()
@Nonnull public ErrorTextProvider addItem(@Nonnull ErrorTextProvider.EField eField, @Nonnull @Nonempty String sText)
eField - The field to be used. May not be null.sText - The text that should contain the placeholder (36)
that will be replaced@Nonnull public ErrorTextProvider addItem(@Nonnull ErrorTextProvider.IFormattableItem aItem)
@Nonnull public ErrorTextProvider setFieldSeparator(@Nonnull String sFieldSep)
@Nonnull public String getErrorText(@Nonnull IError aError, @Nonnull Locale aContentLocale)
IErrorTextProvidergetErrorText in interface IErrorTextProvideraError - The error to be converted. May not be null.aContentLocale - The content locale to be used. May not be null.null String.@Nonnull @ReturnsMutableCopy public ErrorTextProvider getClone()
getClone in interface ICloneable<ErrorTextProvider>Copyright © 2014–2022 Philip Helger. All rights reserved.