refs.add( EntityReference.parseEntityReference( jsonArray.getString( i ) ) );
}
}
}
ValueBuilder valueBuilder = module
.newValueBuilderWithState( actualValueType.type(), new Function<PropertyDescriptor, Object>()
{
@Override
public Object map( PropertyDescriptor descriptor )
{
return values.get( descriptor.qualifiedName() );
}
},new Function<AssociationDescriptor, EntityReference>()
{
@Override
public EntityReference map( AssociationDescriptor associationDescriptor )
{
Object ref = values.get( associationDescriptor.qualifiedName() );
if (ref == null)
return null;
else
return (EntityReference) ref;
}
},new Function<AssociationDescriptor, Iterable<EntityReference>>()
{
@Override
public Iterable<EntityReference> map( AssociationDescriptor associationDescriptor )
{
Object ref = values.get( associationDescriptor.qualifiedName() );
if (ref == null)
return Iterables.empty();
else
return (Iterable<EntityReference>) ref;
}
});
return valueBuilder.newInstance();
} else
{
try
{
if( json instanceof JSONObject )