public static String getProtectedJavaLines( String fn ) {
        StringBuffer sb = new StringBuffer();

        if ( fn.contains( ".sql" ) ) {
            sb.append( "\n-- " );
            sb.append( PROTECTED_CODE );
            sb.append( " -->" );
        }

        else if ( fn.contains( ".xml" ) ) {
            sb.append( "\n\n\n    <!-- " );
            sb.append( PROTECTED_CODE );
            sb.append( " -->" );
        }

        else {
            sb.append( TAB );
            sb.append( "// " );
            sb.append( PROTECTED_CODE );
            sb.append( " -->" );
        }

        List<String> lines = getProtectedLines( fn );
        if ( lines.isEmpty() && !fn.contains( ".sql") && !fn.contains( ".xml")) {
            sb.append( "\n\n}" );
        }
        else if(lines.isEmpty() && fn.contains( ".xml")){
            sb.append( "\n\n</mapper>");
        }
        for ( String line : lines ) {
            sb.append( line );
        }
        return sb.toString();
    }