private <T extends JExpression> T writeAdapterConversion(JAXBObjectBuilder builder, JBlock block, Property property, T propertyVar) {
if (property.getAdapterType() != null) {
JVar adapterVar = builder.getAdapter(property.getAdapterType());
JVar valueVar = block.decl(context.toJClass(property.getComponentAdaptedType()), builder.getWriteVariableManager().createId(property.getName()), JExpr._null());
JTryBlock tryBlock = block._try();
tryBlock.body().assign(valueVar, adapterVar.invoke("marshal").arg(propertyVar));
JCatchBlock catchException = tryBlock._catch(context.toJClass(Exception.class));
JBlock catchBody = catchException.body();
catchBody.invoke(builder.getReadContextVar(), "xmlAdapterError")
.arg(builder.getWriteObject())
.arg(property.getName())
.arg(context.dotclass(property.getAdapterType()))