private void generateTagHandlerAttributes ( TagInfo tagInfo ) throws JasperException { if ( tagInfo . hasDynamicAttributes ( ) ) { out . printil ( "private java.util.HashMap _jspx_dynamic_attrs = new java.util.HashMap();" ) ; } // Declare attributes TagAttributeInfo [ ] attrInfos = tagInfo . getAttributes ( ) ; for ( int i = 0 ; i < attrInfos . length ; i ++ ) { out . printin ( "private " ) ; if ( attrInfos [ i ] . isFragment ( ) ) { out . print ( "javax.servlet.jsp.tagext.JspFragment " ) ; } else { out . print ( JspUtil . toJavaSourceType ( attrInfos [ i ] . getTypeName ( ) ) ) ; out . print ( " " ) ; } out . print ( attrInfos [ i ] . getName ( ) ) ; out . println ( ";" ) ; } out . println ( ) ; // Define attribute getter and setter methods for ( int i = 0 ; i < attrInfos . length ; i ++ ) { // getter method out . printin ( "public " ) ; if ( attrInfos [ i ] . isFragment ( ) ) { out . print ( "javax.servlet.jsp.tagext.JspFragment " ) ; } else { out . print ( JspUtil . toJavaSourceType ( attrInfos [ i ] . getTypeName ( ) ) ) ; out . print ( " " ) ; } out . print ( toGetterMethod ( attrInfos [ i ] . getName ( ) ) ) ; out . println ( " {" ) ; out . pushIndent ( ) ; out . printin ( "return this." ) ; out . print ( attrInfos [ i ] . getName ( ) ) ; out . println ( ";" ) ; out . popIndent ( ) ; out . printil ( "}" ) ; out . println ( ) ; // setter method out . printin ( "public void " ) ; out . print ( toSetterMethodName ( attrInfos [ i ] . getName ( ) ) ) ; if ( attrInfos [ i ] . isFragment ( ) ) { out . print ( "(javax.servlet.jsp.tagext.JspFragment " ) ; } else { out . print ( "(" ) ; out . print ( JspUtil . toJavaSourceType ( attrInfos [ i ] . getTypeName ( ) ) ) ; out . print ( " " ) ; } out . print ( attrInfos [ i ] . getName ( ) ) ; out . println ( ") {" ) ; out . pushIndent ( ) ; out . printin ( "this." ) ; out . print ( attrInfos [ i ] . getName ( ) ) ; out . print ( " = " ) ; out . print ( attrInfos [ i ] . getName ( ) ) ; out . println ( ";" ) ; out . popIndent ( ) ; out . printil ( "}" ) ; out . println ( ) ; } }
Generates declarations for tag handler attributes and defines the getter and setter methods for each .