protected void format ( @ Nonnull final JSFormatter aFormatter , @ Nonnull final String sIndent ) { if ( ! isEmpty ( ) ) aFormatter . plain ( sIndent ) ; final Iterator < Object > aIter = iterator ( ) ; while ( aIter . hasNext ( ) ) { final Object aValue = aIter . next ( ) ; if ( aValue instanceof String ) { int nIdx ; String sValue = ( String ) aValue ; while ( ( nIdx = sValue . indexOf ( ' ' ) ) != - 1 ) { final String sLine = sValue . substring ( 0 , nIdx ) ; if ( sLine . length ( ) > 0 ) aFormatter . plain ( _escape ( sLine ) ) ; sValue = sValue . substring ( nIdx + 1 ) ; aFormatter . nlFix ( ) . plain ( sIndent ) ; } if ( sValue . length ( ) != 0 ) aFormatter . plain ( _escape ( sValue ) ) ; } else if ( aValue instanceof AbstractJSClass ) { ( ( AbstractJSClass ) aValue ) . printLink ( aFormatter ) ; } else if ( aValue instanceof AbstractJSType ) { aFormatter . generatable ( ( AbstractJSType ) aValue ) ; } else throw new IllegalStateException ( "Unsupported value: " + aValue ) ; } if ( ! isEmpty ( ) ) aFormatter . nlFix ( ) ; }
Writes this part into the formatter by using the specified indentation .