mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
xml serialization: Support null values in fields marked as @Attribute (do not add corresponding attribute to output if value is null)
This commit is contained in:
@@ -35,6 +35,8 @@ public class AttributeBinding implements Binding {
|
||||
@Override
|
||||
public Object serialize(@NotNull Object o, Object context, SerializationFilter filter) {
|
||||
final Object v = myAccessor.read(o);
|
||||
if (v == null) return context;
|
||||
|
||||
final Object node = myBinding.serialize(v, context, filter);
|
||||
|
||||
return new org.jdom.Attribute(myAttribute.value(), ((Content)node).getValue());
|
||||
|
||||
Reference in New Issue
Block a user