public CharSequence getJavaScriptOptions ( ) { StringBuilder sb = new StringBuilder ( ) ; this . optionsRenderer . renderBefore ( sb ) ; int count = 0 ; for ( Entry < String , Object > entry : options . entrySet ( ) ) { String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( value instanceof IModelOption < ? > ) value = ( ( IModelOption < ? > ) value ) . wrapOnAssignment ( owner ) ; boolean isLast = ! ( count < options . size ( ) - 1 ) ; if ( value instanceof JsScope ) { // Case of a JsScope sb . append ( this . optionsRenderer . renderOption ( key , ( ( JsScope ) value ) . render ( ) , isLast ) ) ; } else if ( value instanceof ICollectionItemOptions ) { // Case of an ICollectionItemOptions sb . append ( this . optionsRenderer . renderOption ( key , ( ( ICollectionItemOptions ) value ) . getJavascriptOption ( ) , isLast ) ) ; } else if ( value instanceof IComplexOption ) { // Case of an IComplexOption sb . append ( this . optionsRenderer . renderOption ( key , ( ( IComplexOption ) value ) . getJavascriptOption ( ) , isLast ) ) ; } else if ( value instanceof ITypedOption < ? > ) { // Case of an ITypedOption sb . append ( this . optionsRenderer . renderOption ( key , ( ( ITypedOption < ? > ) value ) . getJavascriptOption ( ) , isLast ) ) ; } else { // Other cases sb . append ( this . optionsRenderer . renderOption ( key , value , isLast ) ) ; } count ++ ; } this . optionsRenderer . renderAfter ( sb ) ; return sb ; }
Returns the JavaScript statement corresponding to options .