@Override
protected NodeTuple representJavaBeanProperty(Object javaBean, Property property,
Object propertyValue, Tag customTag) {
if (javaBean instanceof BigJavaBean) {
BigJavaBean bean = (BigJavaBean) javaBean;
NodeTuple standard = super.representJavaBeanProperty(javaBean, property,
propertyValue, customTag);
if (property.getName().equals("numbers")) {
// when the list is small, make it block collection style
if (bean.getNumbers().size() < 5) {
SequenceNode n = (SequenceNode) standard.getValueNode();
return new NodeTuple(standard.getKeyNode(), new SequenceNode(n.getTag(),
true, n.getValue(), n.getStartMark(), n.getEndMark(), false));
}
}
if (property.getName().equals("description")) {
// if description contains ':' use folded scalar style and
// not single quoted scalar style
if (bean.getDescription().indexOf(':') > 0) {
ScalarNode n = (ScalarNode) standard.getValueNode();
return new NodeTuple(standard.getKeyNode(), new ScalarNode(n.getTag(),
n.getValue(), n.getStartMark(), n.getEndMark(), '>'));
}
}
return standard;
} else {