parse correct enabled flag on all field when passed as number, closes #76

This commit is contained in:
kimchy 2010-03-20 14:40:24 +02:00
parent 671bc4e734
commit fa1071d090
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,9 @@ public class JacksonNodes {
if (node.isBoolean()) {
return node.getBooleanValue();
}
if (node.isNumber()) {
return node.getNumberValue().intValue() != 0;
}
String value = node.getTextValue();
return !(value.equals("false") || value.equals("0") || value.equals("off"));
}