private void appendParamValue ( StringBuilder param , StringBuilder result ) { if ( param == null ) throw UncheckedTemplateException . invalidArgumentName ( param ) ; // Object name is the parameter that should be found in the map. // If it's followed by points, the points remain in the "param" buffer. final String objectName = takeUntilDotOrEnd ( param ) ; final Object objectValue = arguments . get ( objectName ) ; Object toAppend ; if ( param . length ( ) != 0 ) { // If this is a chain object.method1.method2.method3 // we recurse toAppend = valueInChain ( objectValue , param ) ; } else { // We evaluate if the obejct is an array // If it's an array we print it nicely toAppend = evaluateIfArray ( objectValue ) ; } if ( null != toAppend ) { result . append ( toAppend ) ; } }
in this case it is obtained by calling recursively the methods on the last obtained object