public String toJSON ( ) { StringBuilder json = new StringBuilder ( ) ; json . append ( "[" ) ; for ( int t = 0 ; t < components . size ( ) ; t ++ ) { if ( t > 0 ) json . append ( "," ) ; T component = components . get ( t ) ; json . append ( "{" ) . append ( "\"label\":\"" ) . append ( component . getDisplayName ( ) ) . append ( "\"" ) . append ( ",\"id\":\"" ) . append ( component . getId ( ) ) . append ( "\"" ) . append ( "}" ) ; } json . append ( "]" ) ; return json . toString ( ) ; }
Serializa os componentes registrados em JSON .