Supplier which is passed in to the constructor.
Several utility methods are also present which allow easy creation of Supplier instances.
| Modifier and Type | Field and Description |
|---|---|
| private final Supplier | |
| private static final Supplier | |
| private static final StackWalker |
| Access | Constructor and Description |
|---|---|
| public | TextBannerFormatter(final Supplier<String>
the supplier for the banner (must not be bannerSupplier, final ExtFormatter null)the delegate formatter (must not be delegate)null)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public static Supplier | Returns: the supplier (notnull)the path to load from (must not be path, Supplier<String> null)the fallback supplier (must not be fallback)null)Create a supplier which loads the banner from the given file path, falling back to the given fallback supplier on error. |
| public static Supplier | Returns: the supplier (notnull)the resource name (must not be resource, ClassLoader null)the class loader to load from (must not be classLoader, Supplier<String> null)the fallback supplier (must not be fallback)null)Create a supplier which loads the banner from a resource in the given class loader, falling back to the given fallback supplier on error. |
| public static Supplier | Returns: the supplier (notnull)the resource name (must not be resource, Supplier<String> null)the fallback supplier (must not be fallback)null)Create a supplier which loads the banner from a resource in the caller's class loader, falling back to the given fallback supplier on error. |
| public static Supplier | Returns: a supplier which returns the given string (notnull)the string (must not be string)null)Create a supplier which always returns the given string. |
| public static Supplier | Returns: the supplier (notnull)the URL to load from (must not be url, Supplier<String> null)the fallback supplier (must not be fallback)null)Create a supplier which loads the banner from the given URL, falling back to the given fallback supplier on error. |
| private static ClassLoader | |
| public static Supplier | Returns: the empty supplier (notnull)Get the empty supplier which always returns an empty string. |
| public String | getHead(final Handler
The target handler (can be null) h)Overrides org. Return the header string for a set of formatted records. |
| private static String |
| bannerSupplier | back to summary |
|---|---|
| private final Supplier<String> bannerSupplier | |
| EMPTY | back to summary |
|---|---|
| private static final Supplier<String> EMPTY | |
| STACK_WALKER | back to summary |
|---|---|
| private static final StackWalker STACK_WALKER | |
| TextBannerFormatter | back to summary |
|---|---|
| public TextBannerFormatter(final Supplier<String> bannerSupplier, final ExtFormatter delegate) Construct a new instance.
| |
| createFileSupplier | back to summary |
|---|---|
| public static Supplier Create a supplier which loads the banner from the given file path, falling back to the given fallback supplier on error. | |
| createResourceSupplier | back to summary |
|---|---|
| public static Supplier Create a supplier which loads the banner from a resource in the given class loader, falling back to the given fallback supplier on error. | |
| createResourceSupplier | back to summary |
|---|---|
| public static Supplier Create a supplier which loads the banner from a resource in the caller's class loader, falling back to the given fallback supplier on error. | |
| createStringSupplier | back to summary |
|---|---|
| public static Supplier Create a supplier which always returns the given string. | |
| createUrlSupplier | back to summary |
|---|---|
| public static Supplier Create a supplier which loads the banner from the given URL, falling back to the given fallback supplier on error. | |
| getClassLoader | back to summary |
|---|---|
| private static ClassLoader getClassLoader(Class<?> clazz) | |
| getEmptySupplier | back to summary |
|---|---|
| public static Supplier Get the empty supplier which always returns an empty string. | |
| getHead | back to summary |
|---|---|
| public String getHead(final Handler h) Overrides org. Doc from java. Return the header string for a set of formatted records. This base class returns an empty string, but this may be overridden by subclasses. | |
| loadStringFromStream | back to summary |
|---|---|
| private static String loadStringFromStream(final InputStream is) throws IOException | |