158 if (line.indexOf("$NAME_CS$", i) != -1) { 159 line = line.replace("$NAME_CS$", csName); 160 } 161 if (line.indexOf("$NAME_ALIASES$", i) != -1) { 162 if ("sun.nio.cs".equals(pkgName)) 163 line = line.replace("$NAME_ALIASES$", 164 "StandardCharsets.aliases_" + clzName); 165 else 166 line = line.replace("$NAME_ALIASES$", 167 "ExtendedCharsets.aliasesFor(\"" + csName + "\")"); 168 } 169 if (line.indexOf("$NAME_HIS$", i) != -1) { 170 line = line.replace("$NAME_HIS$", hisName); 171 } 172 if (line.indexOf("$CONTAINS$", i) != -1) { 173 if (isASCII) 174 line = " return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof " + clzName + "));"; 175 else 176 line = " return (cs instanceof " + clzName + ");"; 177 } 178 if (line.indexOf("$B2CTABLE$") != -1) { 179 line = line.replace("$B2CTABLE$", b2c); 180 } 181 if (line.indexOf("$C2BLENGTH$") != -1) { 182 line = line.replace("$C2BLENGTH$", "0x" + Integer.toString(c2bOff, 16)); 183 } 184 if (line.indexOf("$NONROUNDTRIP_B2C$") != -1) { 185 if (b2cNR.length() == 0) 186 continue; 187 line = line.replace("$NONROUNDTRIP_B2C$", b2cNR); 188 } 189 190 if (line.indexOf("$NONROUNDTRIP_C2B$") != -1) { 191 if (c2bNR.length() == 0) 192 continue; 193 line = line.replace("$NONROUNDTRIP_C2B$", c2bNR); 194 } 195 out.println(line); 196 } 197 out.close(); | 158 if (line.indexOf("$NAME_CS$", i) != -1) { 159 line = line.replace("$NAME_CS$", csName); 160 } 161 if (line.indexOf("$NAME_ALIASES$", i) != -1) { 162 if ("sun.nio.cs".equals(pkgName)) 163 line = line.replace("$NAME_ALIASES$", 164 "StandardCharsets.aliases_" + clzName); 165 else 166 line = line.replace("$NAME_ALIASES$", 167 "ExtendedCharsets.aliasesFor(\"" + csName + "\")"); 168 } 169 if (line.indexOf("$NAME_HIS$", i) != -1) { 170 line = line.replace("$NAME_HIS$", hisName); 171 } 172 if (line.indexOf("$CONTAINS$", i) != -1) { 173 if (isASCII) 174 line = " return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof " + clzName + "));"; 175 else 176 line = " return (cs instanceof " + clzName + ");"; 177 } 178 if (line.indexOf("$ASCIICOMPATIBLE$") != -1) { 179 line = line.replace("$ASCIICOMPATIBLE$", isASCII ? "true" : "false"); 180 } 181 if (line.indexOf("$B2CTABLE$") != -1) { 182 line = line.replace("$B2CTABLE$", b2c); 183 } 184 if (line.indexOf("$C2BLENGTH$") != -1) { 185 line = line.replace("$C2BLENGTH$", "0x" + Integer.toString(c2bOff, 16)); 186 } 187 if (line.indexOf("$NONROUNDTRIP_B2C$") != -1) { 188 if (b2cNR.length() == 0) 189 continue; 190 line = line.replace("$NONROUNDTRIP_B2C$", b2cNR); 191 } 192 193 if (line.indexOf("$NONROUNDTRIP_C2B$") != -1) { 194 if (c2bNR.length() == 0) 195 continue; 196 line = line.replace("$NONROUNDTRIP_C2B$", c2bNR); 197 } 198 out.println(line); 199 } 200 out.close(); |