// TODO Auto-generated method stub
}
public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
Type type = databinding.getType(part);
if (type == null) {
throw new Fault(new Message("NO_MESSAGE_FOR_PART", LOG));
}
Context context = new Context();
// I'm not sure that this is the right type mapping
context.setTypeMapping(type.getTypeMapping());
context.setOverrideTypes(CastUtils.cast(databinding.getOverrideTypes(), String.class));
context.setAttachments(attachments);
Object val = databinding.getService().get(AegisDatabinding.WRITE_XSI_TYPE_KEY);
if ("true".equals(val) || Boolean.TRUE.equals(val)) {
context.setWriteXsiTypes(true);
}
type = TypeUtil.getWriteType(context, obj, type);
try {
ElementWriter writer = new ElementWriter(output);
MessageWriter w2 = writer.getElementWriter(part.getConcreteName());
if (type.isNillable() && type.isWriteOuter() && obj == null) {
w2.writeXsiNil();
return;
}
type.writeObject(obj, w2, context);
w2.close();
} catch (DatabindingException e) {
throw new RuntimeException(e);
}
}