Message accepting argument placeholders in the formatting pattern.
Only "{}" strings are treated as argument placeholders.
Escaped (i.e., "\"-prefixed) or incomplete argument placeholders will be ignored.
Examples of argument placeholders that will be discarded and rendered intact:
{ }
foo\{}
{bar
{buzz}
This class was originally written for Lilith by Jörn Huxhorn and licensed under the LGPL. It has been relicensed here with his permission providing that this attribution remain.
| Modifier and Type | Field and Description |
|---|---|
| private transient Object[] | |
| public static final String | ERROR_MSG_SEPARATOR
Separator for error messages. |
| public static final String | ERROR_PREFIX
Prefix for errors. |
| public static final String | ERROR_SEPARATOR
Separator for errors. |
| public static final String | ERROR_SUFFIX
Suffix for errors. |
| private String | |
| private final String | |
| private final ParameterFormatter. | |
| public static final String | RECURSION_PREFIX
Prefix for recursion. |
| public static final String | RECURSION_SUFFIX
Suffix for recursion. |
| private static final long | |
| private static final ThreadLocal | |
| private final transient Throwable |
| Access | Constructor and Description |
|---|---|
| public | ParameterizedMessage(final String
a formatting pattern pattern, final String[] arguments to be formatted args, final Throwable throwable)
Deprecated
Use
ParameterizedMessage(String, Object[], Throwable) instead
Constructs an instance. |
| public | ParameterizedMessage(final String
a formatting pattern pattern, final Object[] arguments to be formatted args, final Throwable throwable)Constructs an instance. |
| public | ParameterizedMessage(final String
a formatting pattern pattern, final Object... arguments to be formatted args)Constructor with a pattern and multiple arguments. |
| public | ParameterizedMessage(final String
a formatting pattern pattern, final Object an argument arg)Constructor with a pattern and a single argument. |
| public | ParameterizedMessage(final String
a formatting pattern pattern, final Object the first argument arg0, final Object the second argument arg1)Constructor with a pattern and two arguments. |
| Modifier and Type | Method and Description |
|---|---|
| public static int | countArgumentPlaceholders(final String
the message pattern to be analyzed pattern)Returns the number of argument placeholders. |
| public static String | Returns: The String representation.The object. o)This method performs a deep toString of the given Object. |
| private static Throwable | determineThrowable(final Throwable throwable, final Object[] args, final ParameterFormatter.
|
| public boolean | equals(final Object
the reference object with which to compare. object)Overrides java. Indicates whether some other object is "equal to" this one. |
| public static String | |
| public void | formatTo(final StringBuilder
the StringBuilder to write into buffer)Implements org. Writes a text representation of this object into the specified |
| public String | Returns: the message formatting patternImplements org. Gets the format portion of the Message. |
| public String | Returns: the formatted messageImplements org. Returns the formatted message. |
| public Object[] | Returns: the message argumentsImplements org. Gets parameter values, if any. |
| public Throwable | Returns: theThrowable provided along with the messageImplements org. The
|
| public int | |
| public static String | Returns: the identity string as also defined in Object.toString()the Object that is to be converted into an identity string. obj)This method returns the same as if Object.toString() would not have been overridden in obj. |
| private void | |
| public String | |
| private void |
| args | back to summary |
|---|---|
| private transient Object[] args | |
| ERROR_MSG_SEPARATOR | back to summary |
|---|---|
| public static final String ERROR_MSG_SEPARATOR Separator for error messages. | |
| ERROR_PREFIX | back to summary |
|---|---|
| public static final String ERROR_PREFIX Prefix for errors. | |
| ERROR_SEPARATOR | back to summary |
|---|---|
| public static final String ERROR_SEPARATOR Separator for errors. | |
| ERROR_SUFFIX | back to summary |
|---|---|
| public static final String ERROR_SUFFIX Suffix for errors. | |
| formattedMessage | back to summary |
|---|---|
| private String formattedMessage | |
| pattern | back to summary |
|---|---|
| private final String pattern | |
| patternAnalysis | back to summary |
|---|---|
| private final ParameterFormatter. | |
| RECURSION_PREFIX | back to summary |
|---|---|
| public static final String RECURSION_PREFIX Prefix for recursion. | |
| RECURSION_SUFFIX | back to summary |
|---|---|
| public static final String RECURSION_SUFFIX Suffix for recursion. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| STRING_BUILDER_HOLDER | back to summary |
|---|---|
| private static final ThreadLocal<StringBuilder> STRING_BUILDER_HOLDER | |
| throwable | back to summary |
|---|---|
| private final transient Throwable throwable | |
| ParameterizedMessage | back to summary |
|---|---|
| public ParameterizedMessage(final String pattern, final String[] args, final Throwable throwable)
Deprecated Use Constructs an instance.
The
| |
| ParameterizedMessage | back to summary |
|---|---|
| public ParameterizedMessage(final String pattern, final Object[] args, final Throwable throwable) Constructs an instance.
The
| |
| ParameterizedMessage | back to summary |
|---|---|
| public ParameterizedMessage(final String pattern, final Object... args) Constructor with a pattern and multiple arguments.
If the last argument is a | |
| ParameterizedMessage | back to summary |
|---|---|
| public ParameterizedMessage(final String pattern, final Object arg) Constructor with a pattern and a single argument.
If the argument is a | |
| ParameterizedMessage | back to summary |
|---|---|
| public ParameterizedMessage(final String pattern, final Object arg0, final Object arg1) Constructor with a pattern and two arguments.
If the last argument is a | |
| countArgumentPlaceholders | back to summary |
|---|---|
| public static int countArgumentPlaceholders(final String pattern) Returns the number of argument placeholders.
| |
| deepToString | back to summary |
|---|---|
| public static String deepToString(final Object o) This method performs a deep toString of the given Object. Primitive arrays are converted using their respective Arrays.toString methods while special handling is implemented for "container types", i.e. Object[], Map and Collection because those could contain themselves. It should be noted that neither AbstractMap.toString() nor AbstractCollection.toString() implement such a behavior. They only check if the container is directly contained in itself, but not if a contained container contains the original one. Because of that, Arrays.toString(Object[]) isn't safe either. Confusing? Just read the last paragraph again and check the respective toString() implementation. This means, in effect, that logging would produce a usable output even if an ordinary System.out.println(o) would produce a relatively hard-to-debug StackOverflowError. | |
| determineThrowable | back to summary |
|---|---|
| private static Throwable determineThrowable(final Throwable throwable, final Object[] args, final ParameterFormatter. | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object object) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| format | back to summary |
|---|---|
| public static String format(final String pattern, final Object[] args) Returns the formatted message. | |
| formatTo | back to summary |
|---|---|
| public void formatTo(final StringBuilder buffer) Implements org. Doc from org. Writes a text representation of this object into the specified
| |
| getFormat | back to summary |
|---|---|
| public String getFormat() Implements org. Doc from org. Gets the format portion of the Message. | |
| getFormattedMessage | back to summary |
|---|---|
| public String getFormattedMessage() Implements org. Returns the formatted message. If possible, the result will be cached for subsequent invocations. | |
| getParameters | back to summary |
|---|---|
| public Object[] getParameters() Implements org. Doc from org. Gets parameter values, if any. | |
| getThrowable | back to summary |
|---|---|
| public Throwable getThrowable() Implements org. The
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| identityToString | back to summary |
|---|---|
| public static String identityToString(final Object obj) This method returns the same as if Object.toString() would not have been overridden in obj. Note that this isn't 100% secure as collisions can always happen with hash codes. Copied from Object.hashCode():
As much as is reasonably practical, the hashCode method defined by
class
| |
| readObject | back to summary |
|---|---|
| private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| writeObject | back to summary |
|---|---|
| private void writeObject(final ObjectOutputStream out) throws IOException | |