if (node.getType().isAssignableFrom(JavaBeanWithStaticState.class)) {
MappingNode beanNode = (MappingNode) node;
List<NodeTuple> value = beanNode.getValue();
List<NodeTuple> removed = new ArrayList<NodeTuple>();
for (NodeTuple tuple : value) {
ScalarNode keyNode = (ScalarNode) tuple.getKeyNode();
if (keyNode.getValue().equals("color")) {
ScalarNode valueNode = (ScalarNode) tuple.getValueNode();
JavaBeanWithStaticState.color = valueNode.getValue();
} else if (keyNode.getValue().equals("type")) {
ScalarNode valueNode = (ScalarNode) tuple.getValueNode();
JavaBeanWithStaticState.setType(valueNode.getValue());
} else
removed.add(tuple);
}
beanNode.setValue(removed);
JavaBeanWithStaticState bean = (JavaBeanWithStaticState) super