protected void renderPassThruAttributes ( FacesContext context , UIComponent component , String [ ] attrs , boolean shouldRenderDataAttributes ) throws IOException { ResponseWriter writer = context . getResponseWriter ( ) ; if ( ( attrs == null || attrs . length <= 0 ) && shouldRenderDataAttributes == false ) return ; // pre-defined attributes for ( String attribute : component . getAttributes ( ) . keySet ( ) ) { boolean attributeToRender = false ; if ( shouldRenderDataAttributes && attribute . startsWith ( "data-" ) ) { attributeToRender = true ; } if ( ! attributeToRender && attrs != null ) { for ( String ca : attrs ) { if ( attribute . equals ( ca ) ) { attributeToRender = true ; break ; } } } if ( attributeToRender ) { Object value = component . getAttributes ( ) . get ( attribute ) ; if ( shouldRenderAttribute ( value ) ) writer . writeAttribute ( attribute , value . toString ( ) , attribute ) ; } } }
Method that provide ability to render pass through attributes .