public class ArgumentToStringBuilderImpl extends java.lang.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(java.lang.Object target)
Constructor
|
ArgumentToStringBuilderImpl(java.lang.Object target,
int maxArgLength)
Constructor
|
ArgumentToStringBuilderImpl(java.lang.Object target,
int maxArgLength,
int mode)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
append(java.lang.String source)
Append a string to the internal buffer
|
protected void |
appendChar(char ch)
Append the hash code.
|
protected void |
appendClassName(java.lang.Object target)
Append the class name.
|
protected void |
appendHashCode(java.lang.Object target)
Append the hash code.
|
protected java.lang.String |
format(java.lang.String source)
Format the buffer by replacing the whitespaces and cutting
away excessive fluff.
|
protected int |
getMaxArgLength() |
int |
getMode() |
protected java.lang.String |
getStackTrace(java.lang.Throwable throwable)
Gets the stack trace from a Throwable as a String.
|
void |
setMaxArgLength(int maxArgLength) |
void |
setMode(int mode) |
void |
setTarget(java.lang.Object target) |
java.lang.String |
toString()
Invokes the string builder.
|
protected java.lang.String |
toString(boolean[] array)
Create a string representation of a boolean[].
|
protected java.lang.String |
toString(byte[] array)
Create a string representation of a char[].
|
protected java.lang.String |
toString(char[] array)
Create a string representation of a char[].
|
protected java.lang.String |
toString(java.util.Collection collection)
Create a string representation of a java.util.Collection.
|
protected java.lang.String |
toString(java.util.Dictionary dictionary)
Create a string representation of a Dictionary.
|
protected java.lang.String |
toString(double[] array)
Create a string representation of a double[].
|
protected java.lang.String |
toString(float[] array)
Create a string representation of a float[].
|
protected java.lang.String |
toString(int[] array)
Create a string representation of a int[].
|
protected java.lang.String |
toString(long[] array)
Create a string representation of a char[].
|
protected java.lang.String |
toString(java.lang.Object object)
Create a String representation for an arbitrary object.
|
protected java.lang.String |
toString(java.lang.Object[] array)
Create a string representation of an object array.
|
protected java.lang.String |
toString(short[] array)
Create a string representation of a short[].
|
protected java.lang.String |
toString(java.lang.String string)
Create a string representation of a String.
|
protected java.lang.String |
toString(java.lang.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(java.lang.Object target)
target
- the object to printpublic ArgumentToStringBuilderImpl(java.lang.Object target, int maxArgLength)
target
- the object to printmaxArgLength
- the maximum lengthpublic ArgumentToStringBuilderImpl(java.lang.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 InterceptorToStringBuilder
maxArgLength
- The maxArgLength to set.InterceptorToStringBuilder.setMaxArgLength(int)
public void setTarget(java.lang.Object target)
setTarget
in interface InterceptorToStringBuilder
target
- The target to set.InterceptorToStringBuilder.setTarget(java.lang.Object)
public void setMode(int mode)
setMode
in interface InterceptorToStringBuilder
mode
- Set the formatting mode to useInterceptorToStringBuilder.setMode(int)
public int getMode()
public java.lang.String toString()
InterceptorToStringBuilder
toString
in interface InterceptorToStringBuilder
toString
in class java.lang.Object
Object.toString()
protected java.lang.String toString(java.lang.Throwable throwable)
throwable
- the Throwableprotected java.lang.String toString(java.lang.Object[] array)
array
- the array to printprotected java.lang.String toString(boolean[] array)
array
- the array to printprotected java.lang.String toString(char[] array)
array
- the array to printprotected java.lang.String toString(short[] array)
array
- the array to printprotected java.lang.String toString(int[] array)
array
- the array to printprotected java.lang.String toString(long[] array)
array
- the array to printprotected java.lang.String toString(float[] array)
array
- the array to printprotected java.lang.String toString(double[] array)
array
- the array to printprotected java.lang.String toString(java.lang.String string)
string
- the string to printprotected java.lang.String toString(byte[] array)
array
- the array to printprotected java.lang.String toString(java.util.Collection collection)
collection
- the collection to printprotected java.lang.String toString(java.util.Dictionary dictionary)
dictionary
- the collection to printprotected java.lang.String toString(java.lang.Object object)
object
- the objectprotected void appendHashCode(java.lang.Object target)
target
- the object to printprotected void appendClassName(java.lang.Object target)
target
- the object to printprotected void appendChar(char ch)
ch
- the object to printprotected int getMaxArgLength()
protected java.lang.String getStackTrace(java.lang.Throwable throwable)
Gets the stack trace from a Throwable as a String.
throwable
- the Throwable
to be examinedprintStackTrace(PrintWriter)
methodprotected void append(java.lang.String source)
source
- the string to appendprotected java.lang.String format(java.lang.String source)
source
- the source stringCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.