public String getText ( ) { //convert textable to map of text Object key = null ; try { //read bindTemplate String bindTemplate = getTemplate ( ) ; Map < Object , String > textMap = new Hashtable < Object , String > ( ) ; for ( Map . Entry < String , Textable > entry : map . entrySet ( ) ) { key = entry . getKey ( ) ; try { //convert to text textMap . put ( key , ( entry . getValue ( ) ) . getText ( ) ) ; } catch ( Exception e ) { throw new SystemException ( "Unable to build text for key:" + key + " error:" + e . getMessage ( ) , e ) ; } } Debugger . println ( this , "bindTemplate=" + bindTemplate ) ; String formattedOutput = Text . format ( bindTemplate , textMap ) ; Debugger . println ( this , "formattedOutput=" + formattedOutput ) ; return formattedOutput ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new SetupException ( e . getMessage ( ) , e ) ; } }
Convert get text output from each Textable in map . Return the format output using Text . format .