@ Override public String getText ( ) { if ( this . target == null ) return null ; try { //Check if load of template needed if ( ( this . template == null || this . template . length ( ) == 0 ) && this . templateName != null ) { try { this . template = Text . loadTemplate ( templateName ) ; } catch ( Exception e ) { throw new SetupException ( "Cannot load template:" + templateName , e ) ; } } Map < Object , Object > faultMap = JavaBean . toMap ( this . target ) ; if ( this . argumentTextDecorator != null ) { this . argumentTextDecorator . setTarget ( this . target . getArgument ( ) ) ; faultMap . put ( this . argumentKeyName , this . argumentTextDecorator . getText ( ) ) ; } return Text . format ( this . template , faultMap ) ; } catch ( FormatException e ) { throw new FormatFaultException ( this . template , e ) ; } }
Converts the target fault into a formatted text .