protected void appendClassName()

in src/java/org/apache/fulcrum/yaafi/interceptor/util/ArgumentToStringBuilderImpl.java [818:946]


    protected void appendClassName(Object target)
    {
        boolean skipClassName = true;

        if ((this.mode & INCLUDE_CLASSNAME) == 0)
        {
            return;
        }

        if( this.target != null )
        {
            String className = target.getClass().getName();

            if( target instanceof boolean[] )
            {
                this.buffer.append("boolean[]");
            }
            else if( target instanceof byte[] )
            {
                this.buffer.append("byte[]");
            }
            else if( target instanceof char[] )
            {
                this.buffer.append("char[]");
            }
            else if( target instanceof short[] )
            {
                this.buffer.append("short[]");
            }
            else if( target instanceof int[] )
            {
                this.buffer.append("int[]");
            }
            else if( target instanceof long[] )
            {
                this.buffer.append("[ong[]");
            }
            else if( target instanceof float[] )
            {
                this.buffer.append("float[]");
            }
            else if( target instanceof double[] )
            {
                this.buffer.append("double[]");
            }
            else if( target instanceof Boolean )
            {
                this.buffer.append("Boolean");
            }
            else if( target instanceof Character )
            {
                this.buffer.append("Character");
            }
            else if( target instanceof Short )
            {
                this.buffer.append("Short");
            }
            else if( target instanceof Integer )
            {
                this.buffer.append("Integer");
            }
            else if( target instanceof Long )
            {
                this.buffer.append("Long");
            }
            else if( target instanceof Float )
            {
                this.buffer.append("Float");
            }
            else if( target instanceof Double )
            {
                this.buffer.append("Double");
            }
            else if( target instanceof String )
            {
                this.buffer.append("String");
            }
            else if( target instanceof Boolean[] )
            {
                this.buffer.append("Boolean[]");
            }
            else if( target instanceof Character[] )
            {
                this.buffer.append("Character[]");
            }
            else if( target instanceof Short[] )
            {
                this.buffer.append("Short[]");
            }
            else if( target instanceof Integer[] )
            {
                this.buffer.append("Integer[]");
            }
            else if( target instanceof Long[] )
            {
                this.buffer.append("Long[]");
            }
            else if( target instanceof Float[] )
            {
                this.buffer.append("Float[]");
            }
            else if( target instanceof Double[] )
            {
                this.buffer.append("Double[]");
            }
            else if( target instanceof String[] )
            {
                this.buffer.append("String[]");
            }
            else
            {
                skipClassName = false;
            }

            if( skipClassName == false )
            {
                className = StringUtils.replace(className, "java.lang.", "");

                if( className.endsWith(";") )
                {
                    this.buffer.append(className.substring(0,className.length()-1));
                }
                else
                {
                    this.buffer.append(className);
                }
            }
        }
    }