public class ArgumentToStringBuilderImpl extends Object implements InterceptorToStringBuilder
| Modifier and Type | Field and Description |
|---|---|
static int |
INCLUDE_CLASSNAME
include the class name in the result
|
static int |
INCLUDE_HASHCODE
include the hashcode in the result
|
| Constructor and Description |
|---|
ArgumentToStringBuilderImpl()
Constructor
|
ArgumentToStringBuilderImpl(Object target)
Constructor
|
ArgumentToStringBuilderImpl(Object target,
int maxArgLength)
Constructor
|
ArgumentToStringBuilderImpl(Object target,
int maxArgLength,
int mode)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
append(String source)
Append a string to the internal buffer
|
protected void |
appendChar(char ch)
Append the hash code.
|
protected void |
appendClassName(Object target)
Append the class name.
|
protected void |
appendHashCode(Object target)
Append the hash code.
|
protected String |
format(String source)
Format the buffer by replacing the whitespaces and cutting
away excessive fluff.
|
protected int |
getMaxArgLength() |
int |
getMode() |
protected String |
getStackTrace(Throwable throwable)
Gets the stack trace from a Throwable as a String.
|
void |
setMaxArgLength(int maxArgLength) |
void |
setMode(int mode) |
void |
setTarget(Object target) |
String |
toString() |
protected String |
toString(boolean[] array)
Create a string representation of a boolean[].
|
protected String |
toString(byte[] array)
Create a string representation of a char[].
|
protected String |
toString(char[] array)
Create a string representation of a char[].
|
protected String |
toString(Collection<?> collection)
Create a string representation of a java.util.Collection.
|
protected String |
toString(Dictionary<?,?> dictionary)
Create a string representation of a Dictionary.
|
protected String |
toString(double[] array)
Create a string representation of a double[].
|
protected String |
toString(float[] array)
Create a string representation of a float[].
|
protected String |
toString(int[] array)
Create a string representation of a int[].
|
protected String |
toString(long[] array)
Create a string representation of a char[].
|
protected String |
toString(Object object)
Create a String representation for an arbitrary object.
|
protected String |
toString(Object[] array)
Create a string representation of an object array.
|
protected String |
toString(short[] array)
Create a string representation of a short[].
|
protected String |
toString(String string)
Create a string representation of a String.
|
protected String |
toString(Throwable throwable)
Create a String representation for a Throwable.
|
public static final int INCLUDE_CLASSNAME
public static final int INCLUDE_HASHCODE
public ArgumentToStringBuilderImpl()
public ArgumentToStringBuilderImpl(Object target)
target - the object to printpublic ArgumentToStringBuilderImpl(Object target, int maxArgLength)
target - the object to printmaxArgLength - the maximum lengthpublic ArgumentToStringBuilderImpl(Object target, int maxArgLength, int mode)
target - the object to printmaxArgLength - the maximum lengthmode - the formatting mode to usepublic void setMaxArgLength(int maxArgLength)
setMaxArgLength in interface InterceptorToStringBuildermaxArgLength - The maxArgLength to set.InterceptorToStringBuilder.setMaxArgLength(int)public void setTarget(Object target)
setTarget in interface InterceptorToStringBuildertarget - The target to set.InterceptorToStringBuilder.setTarget(java.lang.Object)public void setMode(int mode)
setMode in interface InterceptorToStringBuildermode - Set the formatting mode to useInterceptorToStringBuilder.setMode(int)public int getMode()
public String toString()
toString in class ObjectObject.toString()protected String toString(Throwable throwable)
throwable - the Throwableprotected String toString(Object[] array)
array - the array to printprotected String toString(boolean[] array)
array - the array to printprotected String toString(char[] array)
array - the array to printprotected String toString(short[] array)
array - the array to printprotected String toString(int[] array)
array - the array to printprotected String toString(long[] array)
array - the array to printprotected String toString(float[] array)
array - the array to printprotected String toString(double[] array)
array - the array to printprotected String toString(String string)
string - the string to printprotected String toString(byte[] array)
array - the array to printprotected String toString(Collection<?> collection)
collection - the collection to printprotected String toString(Dictionary<?,?> dictionary)
dictionary - the collection to printprotected String toString(Object object)
object - the objectprotected void appendHashCode(Object target)
target - the object to printprotected void appendClassName(Object target)
target - the object to printprotected void appendChar(char ch)
ch - the object to printprotected int getMaxArgLength()
protected String getStackTrace(Throwable throwable)
Gets the stack trace from a Throwable as a String.
throwable - the Throwable to be examinedprintStackTrace(PrintWriter) methodprotected void append(String source)
source - the string to appendCopyright © 2004–1970 The Apache Software Foundation. All rights reserved.