if ( representedObjects.containsKey( memberValue ) )
{
// the first occurrence of the node must keep the tag
hasAlias = true;
}
Node nodeValue = representData( memberValue );
// TODO: The impl seems not to allow to skip certain values
if ( nodeValue == null )
{
continue;
}
// if possible try to avoid a global tag with a class name
if ( nodeValue instanceof MappingNode && !hasAlias )
{
// the node is a map, set or JavaBean
if ( !Map.class.isAssignableFrom( memberValue.getClass() ) )
{
// the node is set or JavaBean
if ( property.getType() == memberValue.getClass() )
{
// we do not need global tag because the property
// Class is the same as the runtime class
nodeValue.setTag( Tags.MAP );
}
}
}
else if ( memberValue != null && Enum.class.isAssignableFrom( memberValue.getClass() ) )
{
nodeValue.setTag( Tags.STR );
}
if ( nodeKey.getStyle() != null )
{
bestStyle = false;
}