if ((tmp == null) || (tmp.equals(EMPTYSTRING))) {
int nan = cpg.addMethodref(DFS_CLASS,
"setNaN", "(Ljava/lang/String;)V");
il.append(DUP);
il.append(new PUSH(cpg, "NaN"));
il.append(new INVOKEVIRTUAL(nan));
}
tmp = getAttribute("infinity");
if ((tmp == null) || (tmp.equals(EMPTYSTRING))) {
int inf = cpg.addMethodref(DFS_CLASS,
"setInfinity",
"(Ljava/lang/String;)V");
il.append(DUP);
il.append(new PUSH(cpg, "Infinity"));
il.append(new INVOKEVIRTUAL(inf));
}
final int nAttributes = _attributes.getLength();
for (int i = 0; i < nAttributes; i++) {
final String name = _attributes.getQName(i);
final String value = _attributes.getValue(i);
boolean valid = true;
int method = 0;
if (name.equals("decimal-separator")) {
// DecimalFormatSymbols.setDecimalSeparator();
method = cpg.addMethodref(DFS_CLASS,
"setDecimalSeparator", "(C)V");
}
else if (name.equals("grouping-separator")) {
method = cpg.addMethodref(DFS_CLASS,
"setGroupingSeparator", "(C)V");
}
else if (name.equals("minus-sign")) {
method = cpg.addMethodref(DFS_CLASS,
"setMinusSign", "(C)V");
}
else if (name.equals("percent")) {
method = cpg.addMethodref(DFS_CLASS,
"setPercent", "(C)V");
}
else if (name.equals("per-mille")) {
method = cpg.addMethodref(DFS_CLASS,
"setPerMill", "(C)V");
}
else if (name.equals("zero-digit")) {
method = cpg.addMethodref(DFS_CLASS,
"setZeroDigit", "(C)V");
}
else if (name.equals("digit")) {
method = cpg.addMethodref(DFS_CLASS,
"setDigit", "(C)V");
}
else if (name.equals("pattern-separator")) {
method = cpg.addMethodref(DFS_CLASS,
"setPatternSeparator", "(C)V");
}
else if (name.equals("NaN")) {
method = cpg.addMethodref(DFS_CLASS,
"setNaN", "(Ljava/lang/String;)V");
il.append(DUP);
il.append(new PUSH(cpg, value));
il.append(new INVOKEVIRTUAL(method));
valid = false;
}
else if (name.equals("infinity")) {
method = cpg.addMethodref(DFS_CLASS,
"setInfinity",
"(Ljava/lang/String;)V");
il.append(DUP);
il.append(new PUSH(cpg, value));
il.append(new INVOKEVIRTUAL(method));
valid = false;
}
else {
valid = false;
}
if (valid) {
il.append(DUP);
il.append(new PUSH(cpg, value.charAt(0)));
il.append(new INVOKEVIRTUAL(method));
}
}
final int put = cpg.addMethodref(TRANSLET_CLASS,
"addDecimalFormat",
"("+STRING_SIG+DFS_SIG+")V");
il.append(new INVOKEVIRTUAL(put));
}